Update CssStyleApplier.prepare to passively fail if it can't read the file (#1891)
This commit is contained in:
parent
9e7e9da1c3
commit
9facacfb23
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user