Nodes: add asserts to detect invalid links earlier

This commit is contained in:
Jacques Lucke 2022-12-30 14:35:15 +01:00
parent 9cef74f58b
commit 3340cc8102
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}
}