Bug 1345997 - Add a check for the inspector toolbox when checking if the grid inspector or box model is visible. r=jdescottes

MozReview-Commit-ID: 5Ve2COO5Vkc
This commit is contained in:
Gabriel Luong 2017-03-09 16:48:14 -05:00
Родитель 83cdc02ec0
Коммит 143314a407
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -78,8 +78,8 @@ BoxModel.prototype = {
* Returns true if the computed or layout panel is visible, and false otherwise.
*/
isPanelVisible() {
return this.inspector.toolbox.currentToolId === "inspector" &&
this.inspector.sidebar &&
return this.inspector.toolbox && this.inspector.sidebar &&
this.inspector.toolbox.currentToolId === "inspector" &&
(this.inspector.sidebar.getCurrentTabID() === "layoutview" ||
this.inspector.sidebar.getCurrentTabID() === "computedview");
},

Просмотреть файл

@ -201,8 +201,8 @@ GridInspector.prototype = {
* Returns true if the layout panel is visible, and false otherwise.
*/
isPanelVisible() {
return this.inspector.toolbox.currentToolId === "inspector" &&
this.inspector.sidebar &&
return this.inspector.toolbox && this.inspector.sidebar &&
this.inspector.toolbox.currentToolId === "inspector" &&
this.inspector.sidebar.getCurrentTabID() === "layoutview";
},