Bug 1463223 - Check if the autocomplete popup is initialized before performing any action in the rule view. r=pbro draft
authorGabriel Luong <gabriel.luong@gmail.com>
Mon, 21 May 2018 14:57:17 -0400
changeset 797819 3dd91db16cb35c319f4d52eb2c01f3f4e036a0f9
parent 797818 a2dfc3fd6c0c4ea947e16ec9bfbc3712d2c7a626
push id110583
push userbmo:gl@mozilla.com
push dateMon, 21 May 2018 18:57:38 +0000
reviewerspbro
bugs1463223
milestone62.0a1
Bug 1463223 - Check if the autocomplete popup is initialized before performing any action in the rule view. r=pbro MozReview-Commit-ID: 5WWUZ632KF2
devtools/client/inspector/rules/rules.js
--- a/devtools/client/inspector/rules/rules.js
+++ b/devtools/client/inspector/rules/rules.js
@@ -821,17 +821,17 @@ CssRuleView.prototype = {
    *        Update the view even if the element is the same as last time.
    */
   selectElement: function(element, allowRefresh = false) {
     let refresh = (this._viewedElement === element);
     if (refresh && !allowRefresh) {
       return promise.resolve(undefined);
     }
 
-    if (this.popup.isOpen) {
+    if (this._popup && this.popup.isOpen) {
       this.popup.hidePopup();
     }
 
     this.clear(false);
     this._viewedElement = element;
 
     this.clearPseudoClassPanel();
     this.refreshAddRuleButtonState();