diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2019-06-10 09:59:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 09:59:19 +0200 |
commit | 7f3c2e7b0c722c8cef026a7a15ed9296c3c22407 (patch) | |
tree | 0de67e131f8718287f3b36b007faaf4129340496 | |
parent | 138a8f1a99f8b79556e46f487818a451d23170a4 (diff) | |
parent | 37c259552643204f57a808dd848ab1f8f00783b2 (diff) |
Merge pull request #29651 from qarmin/fix_crash_animated_sprite
Fix crash when frames are empty
-rw-r--r-- | scene/2d/animated_sprite.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 25ad6bd5c9..075b0e6252 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) |