Merge pull request #29651 from qarmin/fix_crash_animated_sprite

Fix crash when frames are empty
This commit is contained in:
Gilles Roudière 2019-06-10 09:59:19 +02:00 committed by GitHub
commit 7f3c2e7b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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)