Fix #137169: "Panel Toggle" poll errors if a panel's first child item is a panel

The poll function for `NODE_PT_node_tree_interface_panel_toggle` looks at the
first child item and checks if it has the `is_panel_toggle` property set to
`True`. This fails if the first child is a panel, which doesn't have that
property.

The fix is to simply fall back to returning False if the first child item does
not have the aforementioned property.

Pull Request: https://projects.blender.org/blender/blender/pulls/137171
This commit is contained in:
quackarooni
2025-04-09 10:17:41 +02:00
committed by Jacques Lucke
parent 8f52d535ac
commit a345f86e33

View File

@@ -1007,7 +1007,7 @@ class NODE_PT_node_tree_interface_panel_toggle(Panel):
if not active_item.interface_items:
return False
first_item = active_item.interface_items[0]
return first_item.is_panel_toggle
return getattr(first_item, "is_panel_toggle", False)
def draw(self, context):
layout = self.layout