Properly handle missing toolbox for network requests in browser console (bug 1204035). r=bgrins
authorPanos Astithas <past@mozilla.com>
Fri, 11 Sep 2015 19:56:02 +0300
changeset 296575 9ad4faa7625508a8066e633a4e5a6298188035c3
parent 296574 c34db58fa00778f38d8872e65a8eb7a6e9f6162c
child 296576 98f6e793e3832f3ff7d312a9d9d1b5c5b97de669
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1204035
milestone43.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
Properly handle missing toolbox for network requests in browser console (bug 1204035). r=bgrins
browser/devtools/webconsole/webconsole.js
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -1966,16 +1966,20 @@ WebConsoleFrame.prototype = {
    * Opens the network monitor and highlights the specified request.
    *
    * @param string requestId
    *        The actor ID of the network request.
    */
   openNetworkPanel: function WCF_openNetworkPanel(requestId)
   {
     let toolbox = gDevTools.getToolbox(this.owner.target);
+    // The browser console doesn't have a toolbox.
+    if (!toolbox) {
+      return;
+    }
     return toolbox.selectTool("netmonitor").then(panel => {
       return panel.panelWin.NetMonitorController.inspectRequest(requestId);
     });
   },
 
   /**
    * Handler for page location changes.
    *