From 7b291de3c3b8c58d68a0792e1cf4abe8f2a48ab2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 11 Jun 2025 14:25:56 +0200 Subject: [PATCH] Fix #140193: error when deleting panel with subpanel as first item --- scripts/startup/bl_operators/node.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 1ed3e731ceb..33db9a833a5 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -480,10 +480,11 @@ class NODE_OT_interface_item_remove(NodeInterfaceOperator, Operator): if item: if item.item_type == 'PANEL': - child = item.interface_items - if child and child[0].is_panel_toggle: - panel_toggle = item.interface_items[0] - interface.remove(panel_toggle) + children = item.interface_items + if len(children) > 0: + first_child = children[0] + if isinstance(first_child, bpy.types.NodeTreeInterfaceSocket) and first_child.is_panel_toggle: + interface.remove(first_child) interface.remove(item) interface.active_index = min(interface.active_index, len(interface.items_tree) - 1)