Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-02 19:49:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-02 19:49:34 +0300
commit3f9a751d4799616e138e0e6373f6425741384098 (patch)
tree7f62d901824c31291c82bdf6ad3fa2298db286c9 /source/blender/blenkernel
parentaa41c17d32b92a07c4a9478b638ee58d01eabd46 (diff)
Fix T57586: crash linking node group through material properties editor.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/node.c14
1 files changed, 8 insertions, 6 deletions
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);