From 846f0500ad01b031d6ce05bf964721cc473eb72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Wed, 8 Mar 2023 12:07:33 +0100 Subject: [PATCH] Node tree updates can crash if the tree contains a node group that points at an "undefined" tree type. This can happen if the tree is linked from a library and the path is lost, or if a custom (python) tree is used and the script is not run. The fix is to check if the node group type is valid ("registered") and return an empty list otherwise. --- .../blenkernel/intern/node_tree_anonymous_attributes.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc b/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc index d355f6a768c..a3b2465428d 100644 --- a/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc +++ b/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc @@ -23,6 +23,11 @@ static const aal::RelationsInNode &get_relations_in_node(const bNode &node, Reso { if (node.is_group()) { if (const bNodeTree *group = reinterpret_cast(node.id)) { + /* Undefined tree types have no relations. */ + if (!ntreeIsRegistered(group)) { + return scope.construct(); + } + BLI_assert(group->runtime->anonymous_attribute_relations); return *group->runtime->anonymous_attribute_relations; } -- 2.30.2