Fix T90564: Crash when linking 2 node inputs

Caused by {rB37570a73170e}.

Above commit wasnt taking into account that at this point the link could
still be NULL.

Maniphest Tasks: T90564

Differential Revision: https://developer.blender.org/D12180
This commit is contained in:
Philipp Oeser
2021-08-10 10:27:57 +02:00
parent 05879f2c36
commit 9c0f11344e

View File

@@ -2364,7 +2364,7 @@ bNodeLink *nodeAddLink(
ntree->update |= NTREE_UPDATE_LINKS;
}
if (link->tosock->flag & SOCK_MULTI_INPUT) {
if (link != nullptr && link->tosock->flag & SOCK_MULTI_INPUT) {
link->multi_input_socket_index = node_count_links(ntree, link->tosock) - 1;
}