diff --git a/src/ts/web-ifc-api.ts b/src/ts/web-ifc-api.ts index cd9a4f6d..20c30b60 100644 --- a/src/ts/web-ifc-api.ts +++ b/src/ts/web-ifc-api.ts @@ -29,7 +29,7 @@ let WebIFCWasm: any; let currentScriptPath: string; if (typeof document !== 'undefined') { const currentScriptData = (document.currentScript as HTMLScriptElement); - if (typeof currentScriptData.src !== 'undefined') currentScriptPath = currentScriptData.src.substring(0, currentScriptData.src.lastIndexOf("/") + 1) ; + if (currentScriptData?.src !== undefined) currentScriptPath = currentScriptData.src.substring(0, currentScriptData.src.lastIndexOf("/") + 1) ; } export * from "./ifc-schema";