Bug 1485660 - Avoid exceptions when the connection is closed in middle of the actor's id retrieval. r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 15 Oct 2018 08:36:05 +0000
changeset 496985 f0d97e8bb0813840fce9d2dea039b3deed3c5898
parent 496984 0ea045e6e57f9a8bcba38c0306ec70f859e79aa9
child 496986 174ed200a5d2d4c4e4c8ab98a9b2300aa4f2a9f7
push id9996
push userarchaeopteryx@coole-files.de
push dateThu, 18 Oct 2018 18:37:15 +0000
treeherdermozilla-beta@8efe26839243 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1485660
milestone64.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 1485660 - Avoid exceptions when the connection is closed in middle of the actor's id retrieval. r=jdescottes MozReview-Commit-ID: KvwkISz7OVe Depends on D7456 Differential Revision: https://phabricator.services.mozilla.com/D7457
devtools/shared/protocol.js
--- a/devtools/shared/protocol.js
+++ b/devtools/shared/protocol.js
@@ -1347,17 +1347,20 @@ Front.prototype = extend(Pool.prototype,
    * Send a packet on the connection.
    */
   send: function(packet) {
     if (packet.to) {
       this.conn._transport.send(packet);
     } else {
       this.actor().then(actorID => {
         packet.to = actorID;
-        this.conn._transport.send(packet);
+        // The connection might be closed during the promise resolution
+        if (this.conn._transport) {
+          this.conn._transport.send(packet);
+        }
       }).catch(console.error);
     }
   },
 
   /**
    * Send a two-way request on the connection.
    */
   request: function(packet) {