j3lte / pastebin-js

NodeJS module for Pastebin API
https://www.npmjs.com/package/pastebin-js
MIT License
57 stars 39 forks source link

fixed .length issue #17

Closed dowzhong closed 5 years ago

dowzhong commented 6 years ago

Been sometimes getting this issue. This would fix this up without causing TypeError and making the script exit.

TypeError: Cannot read property 'length' of undefined at Request._callback (/root/paste-reader/node_modules/pastebin-js/lib/methods.js:55:22) at self.callback (/root/paste-reader/node_modules/request/request.js:185:22) at Request.emit (events.js:182:13) at Request.EventEmitter.emit (domain.js:442:20) at Timeout._onTimeout (/root/paste-reader/node_modules/request/request.js:848:16) at ontimeout (timers.js:424:11) at tryOnTimeout (timers.js:288:5) at listOnTimeout (timers.js:251:5) at Timer.processTimers (timers.js:211:10)