From 3639656ada5f81827d221948aeff5c217b2f7feb Mon Sep 17 00:00:00 2001 From: msm Date: Mon, 27 Dec 2021 23:06:47 +0100 Subject: [PATCH] Fix a undefined variable dereference --- src/v1/kaitaiWorker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v1/kaitaiWorker.ts b/src/v1/kaitaiWorker.ts index 2c6bdcae..8a377112 100644 --- a/src/v1/kaitaiWorker.ts +++ b/src/v1/kaitaiWorker.ts @@ -89,7 +89,7 @@ function exportValue(obj: any, debug: IDebugInfo, path: string[], noLazy?: boole Object.getOwnPropertyNames(obj.constructor.prototype).filter(x => x[0] !== "_" && x !== "constructor") : []; for (const propName of propNames) { - const ksyInstanceData = ksyType && ksyType.instancesByJsName[propName] || {}; + const ksyInstanceData = ksyType && ksyType.instancesByJsName && ksyType.instancesByJsName[propName] || {}; const parseMode = ksyInstanceData["-webide-parse-mode"]; const eagerLoad = parseMode === "eager" || (parseMode !== "lazy" && ksyInstanceData.value);