Bug 1150052: move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy
authorMike de Boer <mdeboer@mozilla.com>
Mon, 11 May 2015 16:20:10 +0200
changeset 243268 23ec0661bddd3ac9842c4c16182a9e4bcd6ea56a
parent 243267 cf1c3e838ac128e67c9f384767c85ecb35eb38f6
child 243269 3f78f06e37f6f92dc49ad0a53e9485fb8cd604ce
push id12897
push usermdeboer@mozilla.com
push dateTue, 12 May 2015 11:28:59 +0000
treeherderfx-team@23ec0661bddd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1150052
milestone40.0a1
Bug 1150052: move up weak reference resolving for garbage collected chatboxes to fix JS errors making Loop cry. r=mixedpuppy
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);