Node poll_instance callback is optional, check if it exists before executing.

This commit is contained in:
Lukas Toenne 2013-03-18 19:19:26 +00:00
parent 66c7b54a88
commit b2374f8de3
2 changed files with 2 additions and 2 deletions

@ -662,7 +662,7 @@ static bool node_group_make_test_selected(bNodeTree *ntree, bNode *gnode, const
/* check poll functions for selected nodes */
for (node = ntree->nodes.first; node; node = node->next) {
if (node_group_make_use_node(node, gnode)) {
if (!node->typeinfo->poll_instance(node, ngroup)) {
if (node->typeinfo->poll_instance && !node->typeinfo->poll_instance(node, ngroup)) {
BKE_reportf(reports, RPT_WARNING, "Can not add node '%s' in a group", node->name);
ok = false;
break;

@ -105,7 +105,7 @@ int nodeGroupPoll(bNodeTree *nodetree, bNodeTree *grouptree)
return 0;
for (node=grouptree->nodes.first; node; node=node->next) {
if (!node->typeinfo->poll_instance(node, nodetree)) {
if (node->typeinfo->poll_instance && !node->typeinfo->poll_instance(node, nodetree)) {
valid = 0;
break;
}