Commit 0564f0f5 authored by JC Brand's avatar JC Brand

Handle case were connection is not defined.

parent aee23242
......@@ -71,7 +71,7 @@
clearSession: function () {
this._super.clearSession.apply(this, arguments);
if (this.connection.connected) {
if (typeof this.connection !== 'undefined' && this.connection.connected) {
this.chatboxes.get('controlbox').save({'connected': false});
}
},
......
......@@ -554,8 +554,10 @@
converse.auto_login = false;
converse.chatboxviews.closeAllChatBoxes();
converse.clearSession();
if (typeof converse.connection !== 'undefined') {
converse.connection.disconnect();
converse.connection.reset();
}
};
this.registerGlobalEventHandlers = function () {
......
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