Fix: handle invalid node trees more gracefully
This commit is contained in:
@@ -35,8 +35,10 @@ static const aal::RelationsInNode &get_relations_in_node(const bNode &node, Reso
|
||||
if (!ntreeIsRegistered(group)) {
|
||||
return scope.construct<aal::RelationsInNode>();
|
||||
}
|
||||
|
||||
BLI_assert(group->runtime->anonymous_attribute_inferencing);
|
||||
/* It's possible that the inferencing failed on the group. */
|
||||
if (!group->runtime->anonymous_attribute_inferencing) {
|
||||
return scope.construct<aal::RelationsInNode>();
|
||||
}
|
||||
return group->runtime->anonymous_attribute_inferencing->tree_relations;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +295,13 @@ static std::unique_ptr<bNodeTreeZones> discover_tree_zones(const bNodeTree &tree
|
||||
return {};
|
||||
}
|
||||
|
||||
for (const bNode *node : tree.nodes_by_type("NodeGroupOutput")) {
|
||||
if (tree_zones->zone_by_node_id.contains(node->identifier)) {
|
||||
/* Group output nodes must not be in a zone. */
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
for (const int node_i : all_nodes.index_range()) {
|
||||
const bNode *node = all_nodes[node_i];
|
||||
const int zone_i = tree_zones->zone_by_node_id.lookup_default(node->identifier, -1);
|
||||
|
||||
Reference in New Issue
Block a user