fix for possible (but unlikely) crash.
added NULL check in case nodeAddNodeType() is given an invalid type or the dynamic node cant be found.
This commit is contained in:
@@ -967,6 +967,11 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id)
|
||||
} else
|
||||
ntype= node_get_type(ntree, type, id);
|
||||
|
||||
if(ntype == NULL) {
|
||||
printf("nodeAddNodeType() error: '%d' type invalid\n", type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
node= MEM_callocN(sizeof(bNode), "new node");
|
||||
BLI_addtail(&ntree->nodes, node);
|
||||
node->typeinfo= ntype;
|
||||
|
Reference in New Issue
Block a user