[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48123] trunk/blender/source/blender/ compositor/nodes/COM_GroupNode.cpp: Fix crash in compositing nodes with a node group with missing datablock, can

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jun 20 16:57:50 CEST 2012


Revision: 48123
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48123
Author:   blendix
Date:     2012-06-20 14:57:39 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
Fix crash in compositing nodes with a node group with missing datablock, can
happen with library linking and missing files.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp

Modified: trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp	2012-06-20 14:24:52 UTC (rev 48122)
+++ trunk/blender/source/blender/compositor/nodes/COM_GroupNode.cpp	2012-06-20 14:57:39 UTC (rev 48123)
@@ -37,6 +37,7 @@
 void GroupNode::ungroup(ExecutionSystem &system)
 {
 	bNode *bnode = this->getbNode();
+	bNodeTree *subtree = (bNodeTree *)bnode->id;
 	vector<InputSocket *> &inputsockets = this->getInputSockets();
 	vector<OutputSocket *> &outputsockets = this->getOutputSockets();
 	unsigned int index;
@@ -44,6 +45,10 @@
 	/* get the node list size _before_ adding proxy nodes, so they are available for linking */
 	int nodes_start = system.getNodes().size();
 
+	/* missing node group datablock can happen with library linking */
+	if(!subtree)
+		return;
+
 	for (index = 0; index < inputsockets.size(); index++) {
 		InputSocket *inputSocket = inputsockets[index];
 		bNodeSocket *editorInput = inputSocket->getbNodeSocket();
@@ -64,6 +69,5 @@
 		}
 	}
 
-	bNodeTree *subtree = (bNodeTree *)bnode->id;
 	ExecutionSystemHelper::addbNodeTree(system, nodes_start, subtree, bnode);
 }




More information about the Bf-blender-cvs mailing list