Added NULL-pointer check to avoid crash in node editor. Fixes #31664
authorKonrad Kleine <konrad.wilhelm.kleine@gmail.com>
Fri, 1 Jun 2012 13:42:18 +0000 (13:42 +0000)
committerKonrad Kleine <konrad.wilhelm.kleine@gmail.com>
Fri, 1 Jun 2012 13:42:18 +0000 (13:42 +0000)
source/blender/nodes/intern/node_exec.c

index 3f77638e25aa752e3b6e31a2b9eee50873a78789..d01ef2e2d52966bb10afa232aa91f263cad96391 100644 (file)
@@ -46,7 +46,9 @@
 /* for a given socket, find the actual stack entry */
 bNodeStack *node_get_socket_stack(bNodeStack *stack, bNodeSocket *sock)
 {
-       return stack + sock->stack_index;
+       if (stack && sock)
+               return stack + sock->stack_index;
+       return NULL;
 }
 
 void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out)