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 Jacques Lucke
parent 9fd834fbb3
commit c5f5046efd
Notes: blender-bot 2023-02-14 00:09:06 +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

@ -157,9 +157,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);