Skip to content

Commit 7ec77b8

Browse files
committed
fix: Do not crash in case of a customized loader
1 parent eec4502 commit 7ec77b8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Uno.Wasm.Bootstrap/ts/Uno/WebAssembly/Bootstrapper.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,17 @@ namespace Uno.WebAssembly.Bootstrap {
333333
this.loader.style.setProperty("--dark-theme-accent-color", manifest.darkThemeAccentColor);
334334
}
335335
const img = this.loader.querySelector("img");
336-
if (manifest && manifest.splashScreenImage) {
337-
if (!manifest.splashScreenImage.match(/^(http(s)?:\/\/.)/g)) {
338-
// Local images need to be prefixed with the app based path
339-
manifest.splashScreenImage = `${this._unoConfig.uno_app_base}/${manifest.splashScreenImage}`;
340-
}
336+
if (img) {
337+
if (manifest && manifest.splashScreenImage) {
338+
if (!manifest.splashScreenImage.match(/^(http(s)?:\/\/.)/g)) {
339+
// Local images need to be prefixed with the app based path
340+
manifest.splashScreenImage = `${this._unoConfig.uno_app_base}/${manifest.splashScreenImage}`;
341+
}
341342

342-
img.setAttribute("src", manifest.splashScreenImage);
343-
} else {
344-
img.setAttribute("src", "https://uno-assets.platform.uno/logos/uno-splashscreen-light.png");
343+
img.setAttribute("src", manifest.splashScreenImage);
344+
} else {
345+
img.setAttribute("src", "https://uno-assets.platform.uno/logos/uno-splashscreen-light.png");
346+
}
345347
}
346348
};
347349

0 commit comments

Comments
 (0)