Web Inspector: Missing checks in DebuggerSidebarPanel for DOM debugging support
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Views / DebuggerSidebarPanel.js
index ab26c2a719a72c93a3e64a5faa531d65adc45cdb..c78c33e248810728b4da48f7f6e62c308f90932c 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);
     }