Fix: crash executing geometry nodes on undefined node tree type
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.
Pull Request: https://projects.blender.org/blender/blender/pulls/105564
This commit is contained in:
@@ -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<const bNodeTree *>(node.id)) {
|
||||
/* Undefined tree types have no relations. */
|
||||
if (!ntreeIsRegistered(group)) {
|
||||
return scope.construct<aal::RelationsInNode>();
|
||||
}
|
||||
|
||||
BLI_assert(group->runtime->anonymous_attribute_relations);
|
||||
return *group->runtime->anonymous_attribute_relations;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user