diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index ddfa6251f7a..6c482b20a98 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1727,8 +1727,10 @@ static float2 socket_link_connection_location(const bNode &node, { const float2 socket_location = socket.runtime->location; if (socket.is_multi_input() && socket.is_input() && !(node.flag & NODE_HIDDEN)) { + /* For internal link case, handle number of links as at least 1. */ + const int clamped_total_inputs = math::max(1, socket.runtime->total_inputs); return node_link_calculate_multi_input_position( - socket_location, link.multi_input_sort_id, socket.runtime->total_inputs); + socket_location, link.multi_input_sort_id, clamped_total_inputs); } return socket_location; }