From 59fa2612329d7cccb1afbb035b2b089e91e8291c Mon Sep 17 00:00:00 2001 From: Peter Hirn Date: Wed, 20 Nov 2024 06:19:55 +0100 Subject: [PATCH] Fix currentScriptData check --- src/ts/web-ifc-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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";