transloadit/node-sdk

Are we missing an is undefined check?

Closed this issue · 4 comments

kvz commented

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.

Alright, cheers. Will look into it.

kvz commented
kvz commented

@tim-kos handled

💪 👍