[Bf-blender-cvs] [3f9a751d479] blender2.8: Fix T57586: crash linking node group through material properties editor.

Brecht Van Lommel noreply at git.blender.org
Fri Nov 2 17:50:42 CET 2018


Commit: 3f9a751d4799616e138e0e6373f6425741384098
Author: Brecht Van Lommel
Date:   Fri Nov 2 17:49:34 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB3f9a751d4799616e138e0e6373f6425741384098

Fix T57586: crash linking node group through material properties editor.

===================================================================

M	source/blender/blenkernel/intern/node.c

===================================================================

diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 8e17d63af3f..869e2849be5 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1234,12 +1234,14 @@ void nodePositionRelative(bNode *from_node, bNode *to_node, bNodeSocket *from_so
 	float offset_y = U.widget_unit * tot_sock_idx;
 
 	/* Output socket. */
-	if (SOCK_IN == from_sock->in_out) {
-		tot_sock_idx = BLI_listbase_count(&from_node->outputs);
-		tot_sock_idx += BLI_findindex(&from_node->inputs, from_sock);
-	}
-	else {
-		tot_sock_idx = BLI_findindex(&from_node->outputs, from_sock);
+	if (from_sock) {
+		if (SOCK_IN == from_sock->in_out) {
+			tot_sock_idx = BLI_listbase_count(&from_node->outputs);
+			tot_sock_idx += BLI_findindex(&from_node->inputs, from_sock);
+		}
+		else {
+			tot_sock_idx = BLI_findindex(&from_node->outputs, from_sock);
+		}
 	}
 
 	BLI_assert(tot_sock_idx != -1);



More information about the Bf-blender-cvs mailing list