Fix T103208: unavailable socket linked to multi-input socket crashes

Differential Revision: https://developer.blender.org/D16772
This commit is contained in:
Iliya Katueshenock 2022-12-14 18:28:07 +01:00 committed by Thomas Dinges
parent d6e75e2c23
commit 9992096c49
Notes: blender-bot 2023-02-21 17:59:30 +01:00
Referenced by issue #103208, Geometry Node: Multi input socket cause crash if change type of connected socket
Referenced by issue #102967, 3.4: Potential candidates for corrective releases
1 changed files with 4 additions and 2 deletions

View File

@ -160,9 +160,11 @@ class LazyFunctionForMultiInput : public LazyFunction {
BLI_assert(socket.is_multi_input());
const bNodeTree &btree = socket.owner_tree();
for (const bNodeLink *link : socket.directly_linked_links()) {
if (!(link->is_muted() || nodeIsDanglingReroute(&btree, link->fromnode))) {
inputs_.append({"Input", *base_type_});
if (link->is_muted() || !link->fromsock->is_available() ||
nodeIsDanglingReroute(&btree, link->fromnode)) {
continue;
}
inputs_.append({"Input", *base_type_});
}
const CPPType *vector_type = get_vector_type(*base_type_);
BLI_assert(vector_type != nullptr);