Bug 1571221 - Add a check for 'this.selection' before calling 'destroy()' on it r=gl
☠☠ backed out by 4766d53d47a4 ☠ ☠
authorKrishnal Ciccolella <shellyc23@hotmail.com>
Mon, 05 Aug 2019 15:37:16 +0000
changeset 486207 63ffc8b43cc36864b3cba67a96a2339e62fe9929
parent 486206 1870efc7be2bfca7a0e1fd821df5d54a36d6e6ca
child 486208 996c40dbc9e28ceaf9c8bf1d08e3c27b6af31848
push id91698
push usergluong@mozilla.com
push dateMon, 05 Aug 2019 15:38:11 +0000
treeherderautoland@63ffc8b43cc3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1571221
milestone70.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 1571221 - Add a check for 'this.selection' before calling 'destroy()' on it r=gl Added an if statement to check for `this.selection`. If it is truthy, `destroy()` will be called on it. Differential Revision: https://phabricator.services.mozilla.com/D40643
devtools/shared/fronts/inspector.js
--- a/devtools/shared/fronts/inspector.js
+++ b/devtools/shared/fronts/inspector.js
@@ -504,17 +504,19 @@ class InspectorFront extends FrontClassW
 
   hasHighlighter(type) {
     return this._highlighters.has(type);
   }
 
   destroy() {
     // Selection isn't a Front and so isn't managed by InspectorFront
     // and has to be destroyed manually
-    this.selection.destroy();
+    if (this.selection) {
+      this.selection.destroy();
+    }
     // Highlighter fronts are managed by InspectorFront and so will be
     // automatically destroyed. But we have to clear the `_highlighters`
     // Map as well as explicitly call `finalize` request on all of them.
     this.destroyHighlighters();
     super.destroy();
   }
 
   destroyHighlighters() {