mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
[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
This commit is contained in:
@@ -506,7 +506,12 @@ export function mergeIfValid(
|
||||
}
|
||||
}
|
||||
|
||||
return { customConfig: customSpec?.[1] ?? {} }
|
||||
return {
|
||||
customConfig:
|
||||
customSpec && Array.isArray(customSpec) && customSpec[1]
|
||||
? customSpec[1]
|
||||
: {}
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
|
||||
Reference in New Issue
Block a user