Nodes: add asserts to detect invalid links earlier
This commit is contained in:
@@ -51,6 +51,10 @@ static void update_link_vector(const bNodeTree &ntree)
|
||||
bNodeTreeRuntime &tree_runtime = *ntree.runtime;
|
||||
tree_runtime.links.clear();
|
||||
LISTBASE_FOREACH (bNodeLink *, link, &ntree.links) {
|
||||
/* Check that the link connects nodes within this tree. */
|
||||
BLI_assert(tree_runtime.nodes_by_id.contains(link->fromnode));
|
||||
BLI_assert(tree_runtime.nodes_by_id.contains(link->tonode));
|
||||
|
||||
tree_runtime.links.append(link);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user