Bug 1463223 - Check if the autocomplete popup is initialized before performing any action in the rule view. r=pbro
MozReview-Commit-ID: 5WWUZ632KF2
--- 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();