summaryrefslogtreecommitdiff
path: root/lib/asyncify.js
diff options
context:
space:
mode:
authorReed Feng <reed.feng@autodesk.com>2018-08-03 02:13:46 +0800
committerAlex Early <alexander.early@gmail.com>2018-08-02 11:13:46 -0700
commit5c174fa63b5a7197ff6abe19a97b74ed7e77646d (patch)
tree7bb23733cde4a0a0e7125830e88207b42c21af33 /lib/asyncify.js
parent3741f80b958bd6afde7fa39af55cea886e8bb3ad (diff)
downloadasync-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.js2
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));
});
}