Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Unified Diff: remoting/webapp/me2mom/client_session.js

Issue 8568031: Call plugin.onIq() only when onIq is not null. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/client_session.js
diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js
index 9fcd4d950ff4663a3e80086f841eee7fc4b2c1ff..2b566e337a5b45facddf8f1ace616213564afd1f 100644
--- a/remoting/webapp/me2mom/client_session.js
+++ b/remoting/webapp/me2mom/client_session.js
@@ -272,7 +272,15 @@ remoting.ClientSession.prototype.connectPluginToWcs_ =
/** @param {string} stanza The IQ stanza received. */
var onIq = function(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);
that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698