Web Inspector: Missing checks in DebuggerSidebarPanel for DOM debugging support
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 23:54:41 +0000 (23:54 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 23:54:41 +0000 (23:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177574

Reviewed by Joseph Pecoraro.

Check before using class members that are conditionally constructed based
on DOM debugging support.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype.closed):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222585 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

index 0e7e1b6..21250bb 100644 (file)
@@ -1,5 +1,19 @@
 2017-09-27  Matt Baker  <mattbaker@apple.com>
 
+        Web Inspector: Missing checks in DebuggerSidebarPanel for DOM debugging support
+        https://bugs.webkit.org/show_bug.cgi?id=177574
+
+        Reviewed by Joseph Pecoraro.
+
+        Check before using class members that are conditionally constructed based
+        on DOM debugging support.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WI.DebuggerSidebarPanel.prototype.closed):
+        (WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
+
+2017-09-27  Matt Baker  <mattbaker@apple.com>
+
         Web Inspector: Create ResourceCollectionContentView and make CollectionContentView easier to extend
         https://bugs.webkit.org/show_bug.cgi?id=177419
 
index ab26c2a..c78c33e 100644 (file)
@@ -267,8 +267,10 @@ WI.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WI.NavigationSideba
     {
         super.closed();
 
-        this._domBreakpointTreeController.disconnect();
-        this._domBreakpointTreeController = null;
+        if (this._domBreakpointTreeController) {
+            this._domBreakpointTreeController.disconnect();
+            this._domBreakpointTreeController = null;
+        }
 
         WI.Frame.removeEventListener(null, null, this);
         WI.debuggerManager.removeEventListener(null, null, this);
@@ -376,7 +378,8 @@ WI.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WI.NavigationSideba
         else if (cookie[WI.DebuggerSidebarPanel.SelectedAssertionsCookieKey])
             this._assertionsBreakpointTreeElement.revealAndSelect();
         else if (cookie[WI.DebuggerSidebarPanel.SelectedAllRequestsCookieKey])
-            this._xhrBreakpointTreeController.revealAndSelect(WI.domDebuggerManager.allRequestsBreakpoint);
+            if (this._xhrBreakpointTreeController)
+                this._xhrBreakpointTreeController.revealAndSelect(WI.domDebuggerManager.allRequestsBreakpoint);
         else
             super.restoreStateFromCookie(cookie, relaxedMatchDelay);
     }