Bug 822028 - [toolbox] 'tilt toggle' command breaks if tilt is opened while the inspector is not active, r=paul
authorVictor Porof <vporof@mozilla.com>
Sat, 15 Dec 2012 21:55:11 +0200
changeset 125531 cbaacd40709b64ea7e7254833f6853a372bed3d4
parent 125261 c8a1314aa449e76e5338f4b8a389bc16e29f831e
child 125532 a72eedce6602b984ad3fc9c02f0cd0ff29b7c124
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs822028
milestone20.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 822028 - [toolbox] 'tilt toggle' command breaks if tilt is opened while the inspector is not active, r=paul
browser/devtools/tilt/TiltVisualizer.jsm
--- a/browser/devtools/tilt/TiltVisualizer.jsm
+++ b/browser/devtools/tilt/TiltVisualizer.jsm
@@ -172,20 +172,23 @@ TiltVisualizer.prototype = {
                              false);
     Services.obs.addObserver(this.onNewNodeFromTilt,
                              this.presenter.NOTIFICATIONS.UNHIGHLIGHTING,
                              false);
 
     let target = TargetFactory.forTab(aTab);
     let toolbox = gDevTools.getToolbox(target);
     if (toolbox) {
-      this.inspector = toolbox.getPanel("inspector");
-      this.inspector.selection.on("new-node", this.onNewNodeFromInspector);
-      this.inspector.selection.on("detached", this.onNewNodeFromInspector);
-      this.onNewNodeFromInspector();
+      let panel = toolbox.getPanel("inspector");
+      if (panel) {
+        this.inspector = panel;
+        this.inspector.selection.on("new-node", this.onNewNodeFromInspector);
+        this.inspector.selection.on("detached", this.onNewNodeFromInspector);
+        this.onNewNodeFromInspector();
+      }
     }
   },
 
   /**
    * Unregister inspector event listeners.
    */
   unbindInspector: function TV_unbindInspector()
   {