From 1a5a37c9e47dc4d1f1e1b3ffaf990e792140b912 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 30 May 2020 09:31:46 -0400 Subject: Fix frontend being null if messages are received early (#575) --- ext/bg/js/settings/popup-preview-frame.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js index 28c95efb..21fee7ee 100644 --- a/ext/bg/js/settings/popup-preview-frame.js +++ b/ext/bg/js/settings/popup-preview-frame.js @@ -141,6 +141,7 @@ class PopupPreviewFrame { if (exampleText === null) { return; } exampleText.textContent = text; + if (this._frontend === null) { return; } this._updateSearch(); } @@ -163,6 +164,7 @@ class PopupPreviewFrame { async _updateOptionsContext({optionsContext}) { this._optionsContext = optionsContext; + if (this._frontend === null) { return; } await this._frontend.updateOptions(); await this._updateSearch(); } -- cgit v1.2.3