Add safety check for undefined widgets

This commit is contained in:
Austin Mroz
2025-08-28 08:51:40 -07:00
committed by Alexander Brown
parent 60647fd5b9
commit 3021ea9afe

View File

@@ -3998,6 +3998,13 @@ export class LGraphNode
*/
#arrangeWidgets(widgetStartY: number): void {
if (!this.widgets || !this.widgets.length) return
for (let i = 0; i < this.widgets.length; i++) {
if (!this.widgets[i]) {
console.error('Removing undefined widget in', this)
this.widgets.splice(i, 1)
i--
}
}
const bodyHeight = this.bodyHeight
const startY =