web: Fix issue with error checking in panic function

This commit is contained in:
Daniel Jacobs 2024-07-16 23:29:44 -04:00 committed by Nathan Adams
parent f9312e6cd8
commit befe226f4a
1 changed files with 1 additions and 2 deletions

View File

@ -1975,8 +1975,7 @@ export class RufflePlayer extends HTMLElement {
return; return;
} else if ( } else if (
error instanceof Error && error instanceof Error &&
(error.name === "CompileError" || error.message === "Failed to load Ruffle WASM"
error.message.includes("CompileError"))
) { ) {
const openInNewTab = this.loadedConfig?.openInNewTab; const openInNewTab = this.loadedConfig?.openInNewTab;
const swfUrl = this.loadedConfig && "url" in this.loadedConfig ? new URL(this.loadedConfig.url, document.baseURI) : undefined; const swfUrl = this.loadedConfig && "url" in this.loadedConfig ? new URL(this.loadedConfig.url, document.baseURI) : undefined;