From 20c3d1b109743e33ab60a75d69bf7ede73b15ce2 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Tue, 6 Jun 2023 21:24:02 -0400 Subject: [PATCH] Fixed type guard for non-Typed instances (#4087). --- src.ts/abi/typed.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src.ts/abi/typed.ts b/src.ts/abi/typed.ts index ffbfe58a5..346b2d570 100644 --- a/src.ts/abi/typed.ts +++ b/src.ts/abi/typed.ts @@ -771,7 +771,10 @@ export class Typed { * Returns true only if %%value%% is a [[Typed]] instance. */ static isTyped(value: any): value is Typed { - return (value && value._typedSymbol === _typedSymbol); + return (value + && typeof(value) === "object" + && "_typedSymbol" in value + && value._typedSymbol === _typedSymbol); } /**