From 37c259552643204f57a808dd848ab1f8f00783b2 Mon Sep 17 00:00:00 2001 From: qarmin Date: Mon, 10 Jun 2019 08:36:28 +0200 Subject: [PATCH] Fix crash when frames are empty --- scene/2d/animated_sprite.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 25ad6bd5c90..075b0e6252b 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -646,6 +646,7 @@ void AnimatedSprite::_reset_timeout() { void AnimatedSprite::set_animation(const StringName &p_animation) { ERR_EXPLAIN(vformat("There is no animation with name '%s'.", p_animation)); + ERR_FAIL_COND(frames == NULL) ERR_FAIL_COND(frames->get_animation_names().find(p_animation) == -1); if (animation == p_animation)