Skip to content

Commit

Permalink
make isPromise support null as a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Oct 15, 2018
1 parent 01171b1 commit f6c4ecf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -660,7 +660,7 @@ exports.stackTraceFilter = function() {
* @returns {boolean} Whether or not `value` is a Promise
*/
exports.isPromise = function isPromise(value) {
return typeof value === 'object' && typeof value.then === 'function';
return typeof value === 'object' && value && typeof value.then === 'function';
};

/**
Expand Down

0 comments on commit f6c4ecf

Please sign in to comment.