Skip to content

Commit 777fcac

Browse files
committed
fix Cannot read property 'error' of null
``` rerr = {code: res&&res.statusCode||-1, error: err||result.error||''}; ^ TypeError: Cannot read property 'error' of null at /Users/loulin/qiniu/node_modules/qiniu/qiniu/rpc.js:55:64 at done (/Users/loulin/qiniu/node_modules/qiniu/node_modules/urllib/lib/urllib.js:193:5) at IncomingMessage.<anonymous> (/Users/loulin/qiniu/node_modules/qiniu/node_modules/urllib/lib/urllib.js:304:7) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11) ```
1 parent 24ff512 commit 777fcac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

qiniu/rpc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function post(uri, form, headers, onresp) {
5252
var req = urllib.request(uri, data, function(err, result, res) {
5353
var rerr = null;
5454
if (err || Math.floor(res.statusCode/100) !== 2) {
55-
rerr = {code: res&&res.statusCode||-1, error: err||result.error||''};
55+
rerr = {code: res&&res.statusCode||-1, error: err||result&&result.error||''};
5656
}
5757
onresp(rerr, result, res);
5858
});

0 commit comments

Comments
 (0)