Avoid trying to retrieve non-existing models. fixes #415
This commit is contained in:
parent
e3f20bf1ad
commit
bf61122805
14
converse.js
14
converse.js
@ -3411,17 +3411,19 @@
|
||||
},
|
||||
|
||||
closeAllChatBoxes: function (include_controlbox) {
|
||||
var i, chatbox;
|
||||
// TODO: once Backbone.Overview has been refactored, we should
|
||||
// be able to call .each on the views themselves.
|
||||
this.model.each($.proxy(function (model) {
|
||||
var ids = [];
|
||||
this.model.each(function (model) {
|
||||
var id = model.get('id');
|
||||
if (include_controlbox || id !== 'controlbox') {
|
||||
if (this.get(id)) { // Should always resolve, but shit happens
|
||||
this.get(id).close();
|
||||
}
|
||||
ids.push(id);
|
||||
}
|
||||
}, this));
|
||||
});
|
||||
ids.forEach(function(id) {
|
||||
var chatbox = this.get(id);
|
||||
if (chatbox) { chatbox.close(); }
|
||||
}, this);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -9,6 +9,7 @@ Changelog
|
||||
* Bugfix. clearSessions during unload event would throw an error when not logged in. [gbonvehi]
|
||||
* Bugfix. wrong callback argument mapping in XmppStatus initialize: fullname is null [thierrytiti]
|
||||
* #389 Allow login panel placeholders and roster item 'Name' translations. [gbonvehi]
|
||||
* #415 closeAllChatBoxes is giving ReferenceError when 2 chats are open [nevcos, jcbrand]
|
||||
* Add placeholder for "Insert a smiley" translation [thierrytiti]
|
||||
* Updated French translation [thierrytiti]
|
||||
* CSS fix: position and width of the div #conversejs [thierrytiti]
|
||||
|
Loading…
Reference in New Issue
Block a user