Skip to content

Commit d0874d3

Browse files
committed
make isPromise() return boolean value for null and undefined cases
1 parent b623788 commit d0874d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascript/node/selenium-webdriver/lib/promise.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function isPromise(value) {
3535
try {
3636
// Use array notation so the Closure compiler does not obfuscate away our
3737
// contract.
38-
return value
38+
return value != null
3939
&& (typeof value === 'object' || typeof value === 'function')
4040
&& typeof value['then'] === 'function';
4141
} catch (ex) {

0 commit comments

Comments
 (0)