Fix T102583: Node Wrangler: Fails to set viewer when nodegroup node in tree is missing datablock

Added nullcheck to make sure execution is possible.

Differential Revision: https://developer.blender.org/D16534
This commit is contained in:
Simon Thommes 2022-11-17 13:58:55 +01:00
parent fdbbc147b7
commit 52adb67517
Notes: blender-bot 2023-02-13 14:00:46 +01:00
Referenced by issue blender/blender#102583, Node Wrangler: Fails to set viewer when nodegroup node in tree is missing datablock
1 changed files with 2 additions and 0 deletions

View File

@ -1397,6 +1397,8 @@ class NWPreviewNode(Operator, NWBase):
# get all viewer sockets in a material tree
for node in tree.nodes:
if hasattr(node, "node_tree"):
if node.node_tree is None:
continue
for socket in node.node_tree.outputs:
if is_viewer_socket(socket) and (socket not in sockets):
sockets.append(socket)