fix for crash when node groups loose their ID pointer references (when linked libs don't load)

This commit is contained in:
Campbell Barton 2012-08-02 16:33:38 +00:00
parent 7aa44d088f
commit ba5c635502
2 changed files with 16 additions and 8 deletions

@ -1030,13 +1030,18 @@ static int material_in_nodetree(bNodeTree *ntree, Material *mat)
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
if (node->id && GS(node->id->name) == ID_MA) {
if (node->id == (ID *)mat)
return 1;
if (node->id) {
if (GS(node->id->name) == ID_MA) {
if (node->id == (ID *)mat) {
return 1;
}
}
else if (node->type == NODE_GROUP) {
if (material_in_nodetree((bNodeTree *)node->id, mat)) {
return 1;
}
}
}
else if (node->type == NODE_GROUP)
if (material_in_nodetree((bNodeTree *)node->id, mat))
return 1;
}
return 0;

@ -1815,8 +1815,11 @@ static int node_tree_has_composite_output(bNodeTree *ntree)
return TRUE;
}
else if (node->type == NODE_GROUP) {
if (node_tree_has_composite_output((bNodeTree *)node->id))
return TRUE;
if (node->id) {
if (node_tree_has_composite_output((bNodeTree *)node->id)) {
return TRUE;
}
}
}
}