Преглед на файлове

Fix crash when frames are empty

(cherry picked from commit 37c259552643204f57a808dd848ab1f8f00783b2)
qarmin преди 6 години
родител
ревизия
6de4c53d26
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  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) {
 
 	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)