Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Update CssStyleApplier.prepare to passively fail if it can't read the…
Browse files Browse the repository at this point in the history
… file (#1891)
  • Loading branch information
toasted-nutbread committed Aug 13, 2021
1 parent c99cf4f commit 8520afe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ext/js/dom/sandbox/css-style-applier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/**
Expand Down

0 comments on commit 8520afe

Please sign in to comment.