Bug 877295 - Allow actors to be loaded as addon-sdk modules. r=past
☠☠ backed out by deff9b455b24 ☠ ☠
authorDave Camp <dcamp@mozilla.com>
Mon, 10 Jun 2013 21:16:47 -0700
changeset 146692 5c76c23df42490eb2ef2a97591237236397ebd7f
parent 146691 21075f02a21937569e607218096c45defd95cd21
child 146693 92dcbf76754eae2d1321db8fdc583e5c4cb200d9
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs877295
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 877295 - Allow actors to be loaded as addon-sdk modules. r=past
toolkit/devtools/server/transport.js
--- a/toolkit/devtools/server/transport.js
+++ b/toolkit/devtools/server/transport.js
@@ -214,23 +214,27 @@ LocalDebuggerTransport.prototype = {
       if (aPacket.to) {
         dumpn("Packet " + serial + " sent to " + uneval(aPacket.to));
       } else if (aPacket.from) {
         dumpn("Packet " + serial + " sent from " + uneval(aPacket.from));
       }
     }
     this._deepFreeze(aPacket);
     let other = this.other;
-    Services.tm.currentThread.dispatch(makeInfallible(function() {
-      // Avoid the cost of JSON.stringify() when logging is disabled.
-      if (wantLogging) {
-        dumpn("Received packet " + serial + ": " + JSON.stringify(aPacket, null, 2));
-      }
-      other.hooks.onPacket(aPacket);
-    }, "LocalDebuggerTransport instance's this.other.hooks.onPacket"), 0);
+    if (other) {
+      Services.tm.currentThread.dispatch(makeInfallible(function() {
+        // Avoid the cost of JSON.stringify() when logging is disabled.
+        if (wantLogging) {
+          dumpn("Received packet " + serial + ": " + JSON.stringify(aPacket, null, 2));
+        }
+        if (other.hooks) {
+          other.hooks.onPacket(aPacket);
+        }
+      }, "LocalDebuggerTransport instance's this.other.hooks.onPacket"), 0);
+    }
   },
 
   /**
    * Close the transport.
    */
   close: function LDT_close() {
     if (this.other) {
       // Remove the reference to the other endpoint before calling close(), to