Fix NodeGroup generic verify function crashing if node's ID pointer is NULL.

Another nice crasher - in this case, we just want to nuke all sockets...

Related to T49991.
This commit is contained in:
Bastien Montagne 2016-11-19 12:18:32 +01:00
parent bd6a9fd734
commit fa6a62fac2
1 changed files with 8 additions and 3 deletions

View File

@ -178,9 +178,14 @@ void node_group_verify(struct bNodeTree *ntree, struct bNode *node, struct ID *i
{
/* check inputs and outputs, and remove or insert them */
if (id == node->id) {
bNodeTree *ngroup = (bNodeTree *)node->id;
group_verify_socket_list(ntree, node, &ngroup->inputs, &node->inputs, SOCK_IN);
group_verify_socket_list(ntree, node, &ngroup->outputs, &node->outputs, SOCK_OUT);
if (id == NULL) {
nodeRemoveAllSockets(ntree, node);
}
else {
bNodeTree *ngroup = (bNodeTree *)node->id;
group_verify_socket_list(ntree, node, &ngroup->inputs, &node->inputs, SOCK_IN);
group_verify_socket_list(ntree, node, &ngroup->outputs, &node->outputs, SOCK_OUT);
}
}
}