Bug 1368650 - Prevent NodeActor.destroy from throwing when called more than once. r=bgrins draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 06 Nov 2017 15:31:24 -0800
changeset 693854 dff2094195bfdc3493e8f254004b10421a6d59f2
parent 693853 795030b0e4c5173c768e6c9f1bbcc7b403bcf202
child 739158 22241d1b3ed40775cf8a4cd5b4495024dbd1a02b
push id87939
push userbmo:poirot.alex@gmail.com
push dateMon, 06 Nov 2017 23:35:59 +0000
reviewersbgrins
bugs1368650
milestone58.0a1
Bug 1368650 - Prevent NodeActor.destroy from throwing when called more than once. r=bgrins MozReview-Commit-ID: DxTzq0FY8vb
devtools/server/actors/inspector.js
--- a/devtools/server/actors/inspector.js
+++ b/devtools/server/actors/inspector.js
@@ -228,16 +228,19 @@ var NodeActor = exports.NodeActor = prot
 
   isDocumentElement: function () {
     return this.rawNode.ownerDocument &&
            this.rawNode.ownerDocument.documentElement === this.rawNode;
   },
 
   destroy: function () {
     protocol.Actor.prototype.destroy.call(this);
+    if (!this.walker) {
+      return;
+    }
 
     if (this.mutationObserver) {
       if (!Cu.isDeadWrapper(this.mutationObserver)) {
         this.mutationObserver.disconnect();
       }
       this.mutationObserver = null;
     }
     this.rawNode = null;