Selaa lähdekoodia

Fix crash when frames are empty

qarmin 6 vuotta sitten
vanhempi
commit
37c2595526
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      scene/2d/animated_sprite.cpp

+ 1 - 0
scene/2d/animated_sprite.cpp

@@ -646,6 +646,7 @@ void AnimatedSprite::_reset_timeout() {
 void AnimatedSprite::set_animation(const StringName &p_animation) {
 void AnimatedSprite::set_animation(const StringName &p_animation) {
 
 
 	ERR_EXPLAIN(vformat("There is no animation with name '%s'.", 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);
 	ERR_FAIL_COND(frames->get_animation_names().find(p_animation) == -1);
 
 
 	if (animation == p_animation)
 	if (animation == p_animation)