From 295c7591aec163bde10a71c8e2042b328776ac17 Mon Sep 17 00:00:00 2001 From: Brian Hung Date: Thu, 18 Aug 2022 02:02:20 -0700 Subject: [PATCH] protect against undefined constructor --- src/utils/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/common.ts b/src/utils/common.ts index dae5064e..27a93845 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -27,7 +27,7 @@ export function isDraftable(value: any): boolean { isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || - !!value.constructor[DRAFTABLE] || + !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value) )