|
|
@@ -216,15 +216,17 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
|
|
|
} catch (error) {
|
|
|
const declarationFontURLs = fontURLs.get(srcDeclaration.data);
|
|
|
const fontURL = declarationFontURLs[declarationFontURLs.length - sourceIndex - 1];
|
|
|
- const fontFace = new FontFace("test-font", "url(" + fontURL + ")");
|
|
|
- try {
|
|
|
- await Promise.race(
|
|
|
- [
|
|
|
- fontFace.load().then(() => fontFace.loaded).then(() => source.valid = true),
|
|
|
- new Promise(resolve => setTimeout.call(window, () => { source.valid = true; resolve(); }, FONT_MAX_LOAD_DELAY))
|
|
|
- ]);
|
|
|
- } catch (error) {
|
|
|
- // ignored
|
|
|
+ if (fontURL) {
|
|
|
+ const fontFace = new FontFace("test-font", "url(" + fontURL + ")");
|
|
|
+ try {
|
|
|
+ await Promise.race(
|
|
|
+ [
|
|
|
+ fontFace.load().then(() => fontFace.loaded).then(() => source.valid = true),
|
|
|
+ new Promise(resolve => setTimeout.call(window, () => { source.valid = true; resolve(); }, FONT_MAX_LOAD_DELAY))
|
|
|
+ ]);
|
|
|
+ } catch (error) {
|
|
|
+ // ignored
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|