From 9facacfb23a03c63da4c1cd8c7514b5fd3d3b0f9 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 11 Aug 2021 20:14:19 -0400 Subject: [PATCH] Update CssStyleApplier.prepare to passively fail if it can't read the file (#1891) --- ext/js/dom/sandbox/css-style-applier.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/js/dom/sandbox/css-style-applier.js b/ext/js/dom/sandbox/css-style-applier.js index 84b8450b..375f5ad0 100644 --- a/ext/js/dom/sandbox/css-style-applier.js +++ b/ext/js/dom/sandbox/css-style-applier.js @@ -43,7 +43,15 @@ class CssStyleApplier { * Loads the data file for use. */ async prepare() { - this._styleData = await this._fetchJsonAsset(this._styleDataUrl); + let styleData; + try { + styleData = await this._fetchJsonAsset(this._styleDataUrl); + } catch (e) { + console.error(e); + } + if (Array.isArray(styleData)) { + this._styleData = styleData; + } } /**