diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-11 23:12:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-11 23:12:45 +0400 |
commit | 21e4b12e7a1b821e0eab2c1223e8519a0e85df5e (patch) | |
tree | daef4daf3f675c6ddeb6729d84cfdedbd3849906 /source | |
parent | cf0d350b5199b2a5ecc4b70e9fba51ae780b3711 (diff) |
safety check when making a node local- make sure its already in the node tree.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 5ffdfe6d71d..ca61b532862 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -644,8 +644,9 @@ static PointerRNA rna_NodeTree_active_node_get(PointerRNA *ptr) static void rna_NodeTree_active_node_set(PointerRNA *ptr, PointerRNA value) { bNodeTree *ntree = (bNodeTree *)ptr->data; - if (value.data) - nodeSetActive(ntree, (bNode *)value.data); + bNode *node = (bNode *)value.data; + if (node && BLI_findindex(&ntree->nodes, node) != -1) + nodeSetActive(ntree, node); else nodeClearActive(ntree); } |