Skip to content

Commit 1c6ca61

Browse files
committed
tighten Promise test
1 parent 62bbf98 commit 1c6ca61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/otr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@
596596
if (msg) {
597597
this.io(msg, meta)
598598

599-
if (Promise && typeof Promise.resolve === 'function')
599+
if (typeof Promise !== 'undefined' && typeof Promise.resolve === 'function')
600600
return Promise.resolve(msg)
601601
}
602602

@@ -658,7 +658,7 @@
658658
if (msg.msg) {
659659
this.trigger('ui', [msg.msg, !!msg.encrypted, meta])
660660

661-
if (Promise && typeof Promise.resolve === 'function')
661+
if (typeof Promise !== 'undefined' && typeof Promise.resolve === 'function')
662662
return Promise.resolve([msg.msg, !!msg.encrypted])
663663
}
664664

0 commit comments

Comments
 (0)