Skip to content

Are we missing an is undefined check? #48

@kvz

Description

@kvz

Just got:

/Users/kvz/code/content/node_modules/transloadit/lib/TransloaditClient.js:588
        var body = _ref5.body,
                        ^

TypeError: Cannot read property 'body' of undefined
    at Request._callback (/Users/kvz/code/content/node_modules/transloadit/lib/TransloaditClient.js:588:25)
    at self.callback (/Users/kvz/code/content/node_modules/transloadit/node_modules/request/request.js:187:22)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at Timeout._onTimeout (/Users/kvz/code/content/node_modules/transloadit/node_modules/request/request.js:762:12)
    at ontimeout (timers.js:488:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:283:5)

Only got the transpiled code:

So that seems another issue, we don't ship working sourcemaps right now.

Patched around it via:

        if (err) {
          return cb(err);
        }

        if (!_ref5) {
          return cb(new Error('No data for request!'));
        }

        var body = _ref5.body,
            statusCode = _ref5.statusCode;

for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions