[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40168] branches/cycles/intern/cycles/ blender/blender_shader.cpp: Cycles: fix crash with group node sockets that don't connect to any node

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Sep 12 16:47:37 CEST 2011


Revision: 40168
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40168
Author:   blendix
Date:     2011-09-12 14:47:36 +0000 (Mon, 12 Sep 2011)
Log Message:
-----------
Cycles: fix crash with group node sockets that don't connect to any node
inside the group.

Modified Paths:
--------------
    branches/cycles/intern/cycles/blender/blender_shader.cpp

Modified: branches/cycles/intern/cycles/blender/blender_shader.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_shader.cpp	2011-09-12 14:28:21 UTC (rev 40167)
+++ branches/cycles/intern/cycles/blender/blender_shader.cpp	2011-09-12 14:47:36 UTC (rev 40168)
@@ -519,7 +519,10 @@
 			to_name = b_to_sock.name();
 		}
 
-		graph->connect(from_node->output(from_name.c_str()), to_node->input(to_name.c_str()));
+		/* in case of groups there may not actually be a node inside the group
+		   that the group socket connects to, so from_node or to_node may be NULL */
+		if(from_node && to_node)
+			graph->connect(from_node->output(from_name.c_str()), to_node->input(to_name.c_str()));
 	}
 }
 




More information about the Bf-blender-cvs mailing list