fix: handle unhandled promise rejections (#2568)

This commit is contained in:
Niklas von Hertzen
2021-07-12 19:01:43 +08:00
committed by GitHub
parent 382853cb33
commit 4555940d0b
6 changed files with 181 additions and 45 deletions

View File

@ -87,7 +87,9 @@ export class Cache {
}
if (isBlobImage(src) || isRenderable(src)) {
this._cache[src] = this.loadImage(src);
(this._cache[src] = this.loadImage(src)).catch(() => {
// prevent unhandled rejection
});
return result;
}