Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lmandel
authorMike de Boer <mdeboer@mozilla.com>
Mon, 11 May 2015 16:20:10 +0200
changeset 276862 21a0c8ae355b64b8fc6643a4d663df4e9e0d07ab
parent 276861 b40e595a89a637cc41f6df430b7cfa03d5d59b2d
child 276863 effb87cfe721ef9bd42c9252d95c804b5df0293c
push id3356
push userbsmedberg@mozilla.com
push dateThu, 09 Jul 2015 21:52:23 +0000
reviewersmixedpuppy, lmandel
bugs1150052
milestone40.0a2
Bug 1150052 - Move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy, a=lmandel
browser/base/content/socialchat.xml
--- a/browser/base/content/socialchat.xml
+++ b/browser/base/content/socialchat.xml
@@ -550,18 +550,17 @@
       <method name="openChat">
         <parameter name="aOrigin"/>
         <parameter name="aTitle"/>
         <parameter name="aURL"/>
         <parameter name="aMode"/>
         <parameter name="aCallback"/>
         <body><![CDATA[
           let cb = this.chatboxForURL.get(aURL);
-          if (cb) {
-            cb = cb.get();
+          if (cb && (cb = cb.get())) {
             // A chatbox is still alive to us when it's parented and still has
             // content.
             if (cb.parentNode && cb.contentWindow) {
               this.showChat(cb, aMode);
               if (aCallback) {
                 if (cb._callbacks == null) {
                   // Chatbox has already been created, so callback now.
                   aCallback(cb);