From 75a56c460da3ec74090013c487615ee3e2ddefdb Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 8 Jun 2025 00:55:59 -0700 Subject: [PATCH] [fix] Prevent error when deleting nodes with missing definitions Adds defensive array access checks in widgetInputs.ts to handle cases where customSpec is not a valid array when merging widget configurations. This resolves the 'Cannot read properties of null (reading "1")' error that occurs when attempting to delete nodes whose definitions have been removed. Fixes #8338 --- src/extensions/core/widgetInputs.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extensions/core/widgetInputs.ts b/src/extensions/core/widgetInputs.ts index ee6dab683..0d2515531 100644 --- a/src/extensions/core/widgetInputs.ts +++ b/src/extensions/core/widgetInputs.ts @@ -506,7 +506,12 @@ export function mergeIfValid( } } - return { customConfig: customSpec?.[1] ?? {} } + return { + customConfig: + customSpec && Array.isArray(customSpec) && customSpec[1] + ? customSpec[1] + : {} + } } app.registerExtension({