Skip to content

Commit 4aeae79

Browse files
committed
Thorough promise check for denodeify's return
1 parent 5dc7050 commit 4aeae79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/node-extensions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Promise.denodeify = function (fn, argumentCount) {
2323
else resolve(res)
2424
})
2525
var res = fn.apply(self, args)
26-
if (res && res.then) {
26+
if (res && (typeof res === 'object' || typeof res === 'function') && typeof res.then === 'function') {
2727
resolve(res)
2828
}
2929
})

0 commit comments

Comments
 (0)