Fix for crasher when node group tree datablocks are missing.
authorLukas Toenne <lukas.toenne@googlemail.com>
Sun, 20 Nov 2011 16:57:50 +0000 (16:57 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Sun, 20 Nov 2011 16:57:50 +0000 (16:57 +0000)
source/blender/nodes/composite/nodes/node_composite_common.c

index 1b38609ce24d49011f3bf0f60f2574ff2c375bcb..f3e0edfc69159bea7942d309ce837da017cbcc46 100644 (file)
@@ -119,6 +119,9 @@ static void *group_initexec(bNode *node)
        bNodeSocket *sock;
        bNodeStack *ns;
        
+       if (!ngroup)
+               return NULL;
+       
        /* initialize the internal node tree execution */
        exec = ntreeCompositBeginExecTree(ngroup, 0);
        
@@ -137,7 +140,8 @@ static void group_freeexec(bNode *UNUSED(node), void *nodedata)
 {
        bNodeTreeExec *gexec= (bNodeTreeExec*)nodedata;
        
-       ntreeCompositEndExecTree(gexec, 0);
+       if (gexec)
+               ntreeCompositEndExecTree(gexec, 0);
 }
 
 /* Copy inputs to the internal stack.
@@ -191,6 +195,9 @@ static void group_execute(void *data, int thread, struct bNode *node, void *node
 {
        bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
        
+       if (!exec)
+               return;
+       
        /* XXX same behavior as trunk: all nodes inside group are executed.
         * it's stupid, but just makes it work. compo redesign will do this better.
         */