aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-11 20:14:19 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-12 20:49:52 -0400
commit8520afe6d840379544a9baa1798a60523e92c6bc (patch)
tree3469d97603e795814650344e06bcc608ec5b085f
parentc99cf4fe42761df941dc6b047159dd06ae67a943 (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;
+ }
}
/**