Bug 1013722 - Fix ContentSearch.jsm error: TypeError: msg.target.messageManager is undefined. r=felipe

This commit is contained in:
Drew Willcoxon 2014-05-21 14:20:29 -07:00
parent 4ea5851934
commit 6e55dbfc46

View File

@ -120,7 +120,12 @@ this.ContentSearch = {
},
_reply: function (msg, type, data) {
msg.target.messageManager.sendAsyncMessage(...this._msgArgs(type, data));
// Due to _initService, we reply asyncly to messages, and by the time we
// reply the browser we're responding to may have been destroyed. In that
// case messageManager is null.
if (msg.target.messageManager) {
msg.target.messageManager.sendAsyncMessage(...this._msgArgs(type, data));
}
},
_broadcast: function (type, data) {