Commit f9b09052 authored by JC Brand's avatar JC Brand

core: Make sure `window.converse` is defined before assigning to it.

parent 75c11a20
...@@ -1884,13 +1884,16 @@ _converse.api = { ...@@ -1884,13 +1884,16 @@ _converse.api = {
if (reject) { if (reject) {
promise = new Promise((resolve, reject) => _converse.connection.sendIQ(stanza, resolve, reject, timeout)); promise = new Promise((resolve, reject) => _converse.connection.sendIQ(stanza, resolve, reject, timeout));
} else { } else {
promise = new Promise((resolve, reject) => _converse.connection.sendIQ(stanza, resolve, resolve, timeout)); promise = new Promise(resolve => _converse.connection.sendIQ(stanza, resolve, resolve, timeout));
} }
_converse.api.trigger('send', stanza); _converse.api.trigger('send', stanza);
return promise; return promise;
} }
}; };
window.converse = window.converse || {};
/** /**
* ### The Public API * ### The Public API
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment