diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-08-11 20:14:19 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-08-12 20:49:52 -0400 |
commit | 8520afe6d840379544a9baa1798a60523e92c6bc (patch) | |
tree | 3469d97603e795814650344e06bcc608ec5b085f /ext/js | |
parent | c99cf4fe42761df941dc6b047159dd06ae67a943 (diff) |
Update CssStyleApplier.prepare to passively fail if it can't read the file (#1891)
Diffstat (limited to 'ext/js')
-rw-r--r-- | ext/js/dom/sandbox/css-style-applier.js | 10 |
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; + } } /** |