summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2019-01-25 09:09:10 -0300
committerJuan Linietsky <reduzio@gmail.com>2019-01-25 09:09:32 -0300
commitc743da100d53cbd63ecdca19fa840095f707096c (patch)
treee426a2e005eb5a22bdce0335308b9e25506c8b3f /scene
parent00ec3e9d2a296903688272aa64190935dcb74897 (diff)
Avoid crashing in #23302
Diffstat (limited to 'scene')
-rw-r--r--scene/animation/animation_tree.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index 706717a8e3..dc022bcd70 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