Check for nullpointers.
authorJeroen Bakker <j.bakker@atmind.nl>
Tue, 3 Jul 2012 08:54:07 +0000 (08:54 +0000)
committerJeroen Bakker <j.bakker@atmind.nl>
Tue, 3 Jul 2012 08:54:07 +0000 (08:54 +0000)
The ID of group nodes are not always filled.

source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/material.c

index 79beb900306a73f558233b1b5bc34d52e6359e7f..692c696803d5f8eca5bffc88bca15dcdcbc10499 100644 (file)
@@ -366,7 +366,7 @@ static void dag_add_material_nodetree_driver_relations(DagForest *dag, DagNode *
                if (n->id && GS(n->id->name) == ID_MA) {
                        dag_add_material_driver_relations(dag, node, (Material *)n->id);
                }
-               else if (n->type == NODE_GROUP) {
+               else if (n->type == NODE_GROUP && n->id) {
                        dag_add_material_nodetree_driver_relations(dag, node, (bNodeTree *)n->id);
                }
        }
index 7e8e5455df5659daa4d4b6dd530052e341608ddc..ac0728327072848ee2e8500afc8fd7895be648ad 100644 (file)
@@ -1071,7 +1071,7 @@ static void material_node_drivers_update(Scene *scene, bNodeTree *ntree, float c
                        /* TODO: prevent infinite recursion here... */
                        material_drivers_update(scene, (Material *)node->id, ctime);
                }
-               else if (node->type == NODE_GROUP) {
+               else if (node->type == NODE_GROUP && node->id) {
                        material_node_drivers_update(scene, (bNodeTree *)node->id, ctime);
                }
        }