diff options
author | Reed Feng <reed.feng@autodesk.com> | 2018-08-03 02:13:46 +0800 |
---|---|---|
committer | Alex Early <alexander.early@gmail.com> | 2018-08-02 11:13:46 -0700 |
commit | 5c174fa63b5a7197ff6abe19a97b74ed7e77646d (patch) | |
tree | 7bb23733cde4a0a0e7125830e88207b42c21af33 /lib/asyncify.js | |
parent | 3741f80b958bd6afde7fa39af55cea886e8bb3ad (diff) | |
download | async-5c174fa63b5a7197ff6abe19a97b74ed7e77646d.tar.gz |
[issue-1568][bug]: make sure error object defined before access its message (#1569)
Diffstat (limited to 'lib/asyncify.js')
-rw-r--r-- | lib/asyncify.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asyncify.js b/lib/asyncify.js index 168f88a..2457377 100644 --- a/lib/asyncify.js +++ b/lib/asyncify.js @@ -87,7 +87,7 @@ function handlePromise(promise, callback) { return promise.then(value => { invokeCallback(callback, null, value); }, err => { - invokeCallback(callback, err.message ? err : new Error(err)); + invokeCallback(callback, err && err.message ? err : new Error(err)); }); } |