From c743da100d53cbd63ecdca19fa840095f707096c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 25 Jan 2019 09:09:10 -0300 Subject: [PATCH] Avoid crashing in #23302 --- scene/animation/animation_tree.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 706717a8e3f..dc022bcd706 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -685,6 +685,10 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { track = track_animation; } break; + default: { + ERR_PRINT("Animation corrupted (invalid track type"); + continue; + } } track_cache[path] = track; @@ -853,6 +857,9 @@ void AnimationTree::_process_graph(float p_delta) { for (int i = 0; i < a->get_track_count(); i++) { NodePath path = a->track_get_path(i); + + ERR_CONTINUE(!track_cache.has(path)); + TrackCache *track = track_cache[path]; if (track->type != a->track_get_type(i)) { continue; //may happen should not