summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-11 20:14:19 -0400
committerGitHub <noreply@github.com>2021-08-11 20:14:19 -0400
commit9facacfb23a03c63da4c1cd8c7514b5fd3d3b0f9 (patch)
tree05addc41c7e23759b60ebe5ada4c933a962bbd27
parent9e7e9da1c3de43b9214ff8f051fc4fd07109b2de (diff)
Update CssStyleApplier.prepare to passively fail if it can't read the file (#1891)
-rw-r--r--ext/js/dom/sandbox/css-style-applier.js10
1 files changed, 9 insertions, 1 deletions
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;
+ }
}
/**