Commit 17284478 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Call plugin.onIq() only when onIq is not null.


Review URL: http://codereview.chromium.org/8568031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110896 0039d316-1c4b-4281-b951-d872f2087c98
parent 24345238
...@@ -272,7 +272,15 @@ remoting.ClientSession.prototype.connectPluginToWcs_ = ...@@ -272,7 +272,15 @@ remoting.ClientSession.prototype.connectPluginToWcs_ =
/** @param {string} stanza The IQ stanza received. */ /** @param {string} stanza The IQ stanza received. */
var onIq = function(stanza) { var onIq = function(stanza) {
remoting.debug.logIq(false, stanza); remoting.debug.logIq(false, stanza);
that.plugin.onIq(stanza); if (that.plugin.onIq) {
that.plugin.onIq(stanza);
} else {
// plugin.onIq may not be set after the plugin has been shut
// down. Particularly this happens when we receive response to
// session-terminate stanza.
remoting.debug.log(
'plugin.onIq is not set so dropping incoming message.');
}
} }
remoting.wcs.setOnIq(onIq); remoting.wcs.setOnIq(onIq);
that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid,
......
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