Fix T49636: material draw mode crash with displacement and missing group input node.

This commit is contained in:
Brecht Van Lommel 2016-10-12 13:10:09 +02:00
parent a54242503e
commit 5f16382195

@ -327,6 +327,7 @@ static void ntree_shader_link_builtin_group_normal(
/* Need to update tree so all node instances nodes gets proper sockets. */
bNode *group_input_node = ntreeFindType(group_ntree, NODE_GROUP_INPUT);
node_group_verify(ntree, group_node, &group_ntree->id);
if (group_input_node)
node_group_input_verify(group_ntree, group_input_node, &group_ntree->id);
ntreeUpdateTree(G.main, group_ntree);
/* Assumes sockets are always added at the end. */
@ -370,7 +371,7 @@ static void ntree_shader_link_builtin_group_normal(
group_displacement_socket);
ntreeUpdateTree(G.main, group_ntree);
}
else {
else if (group_input_node) {
/* Connect group node normal input. */
nodeAddLink(ntree,
node_from, socket_from,