From b56d1abc47d610475bec2cd01b9d4c1c660c85d0 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 1 Aug 2022 23:26:40 +0800 Subject: [PATCH] Fix crash when executing `AnimationTreePlayer.are_nodes_connected` (cherry picked from commit 9d923764c958791b411e0a398d83e3a91dc41869) --- scene/animation/animation_tree_player.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index e33520eff90..ef4bbdb1d4e 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -1398,6 +1398,7 @@ bool AnimationTreePlayer::are_nodes_connected(const StringName &p_src_node, cons ERR_FAIL_COND_V(p_src_node == p_dst_node, false); NodeBase *dst = node_map[p_dst_node]; + ERR_FAIL_INDEX_V(p_dst_input, dst->inputs.size(), false); return dst->inputs[p_dst_input].node == p_src_node; }