Bug 1297758 - Fix race in inspector initialization to prevent this._splitter is undefined exception. r=bgrins draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 28 Sep 2016 06:54:20 -0700
changeset 418997 1852ce14384a47cc42a69112d90525658f1031e7
parent 418996 9382c2a6d1dd218dd2d3af506655389b66cc552f
child 532460 d4a9f6c4499b6173f947b830f841077f7451118a
push id30810
push userbmo:poirot.alex@gmail.com
push dateThu, 29 Sep 2016 10:31:35 +0000
reviewersbgrins
bugs1297758
milestone52.0a1
Bug 1297758 - Fix race in inspector initialization to prevent this._splitter is undefined exception. r=bgrins MozReview-Commit-ID: HkHLnCaNiFK
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -442,18 +442,16 @@ Inspector.prototype = {
   /**
    * Build Splitter located between the main and side area of
    * the Inspector panel.
    */
   setupSplitter: function () {
     let SplitBox = this.React.createFactory(this.browserRequire(
       "devtools/client/shared/components/splitter/split-box"));
 
-    this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
-
     let splitter = SplitBox({
       className: "inspector-sidebar-splitter",
       initialWidth: INITIAL_SIDEBAR_SIZE,
       initialHeight: INITIAL_SIDEBAR_SIZE,
       minSize: MIN_SIDEBAR_SIZE,
       splitterSize: 1,
       endPanelControl: true,
       startPanel: this.InspectorTabPanel({
@@ -463,16 +461,18 @@ Inspector.prototype = {
         id: "inspector-sidebar-container"
       }),
       vert: this.useLandscapeMode(),
     });
 
     this._splitter = this.ReactDOM.render(splitter,
       this.panelDoc.getElementById("inspector-splitter-box"));
 
+    this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
+
     // Persist splitter state in preferences.
     this.sidebar.on("show", this.onSidebarShown);
     this.sidebar.on("hide", this.onSidebarHidden);
     this.sidebar.on("destroy", this.onSidebarHidden);
   },
 
   /**
    * Splitter clean up.