diff --git a/lib/c-promise.js b/lib/c-promise.js index 46ab8b8..d2bf72a 100644 --- a/lib/c-promise.js +++ b/lib/c-promise.js @@ -1290,6 +1290,8 @@ class CPromise extends Promise { } static [_objectToCPromise](thing) { + if(!thing) return null; + const convertMethod = thing[_toCPromise]; if (typeof convertMethod === 'function') { @@ -1308,7 +1310,7 @@ class CPromise extends Promise { return returnedValue; } - if (thing && typeof thing.then === 'function') { + if (typeof thing.then === 'function') { return new this((resolve, reject, {onCancel}) => { if (typeof thing.cancel === 'function') { onCancel(reason => {