Update CssStyleApplier.prepare to passively fail if it can't read the file (#1891)

This commit is contained in:
toasted-nutbread 2021-08-11 20:14:19 -04:00 committed by GitHub
parent 9e7e9da1c3
commit 9facacfb23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}
/**