diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 22744506472..80defac0794 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -99,7 +99,7 @@ public: const Map::Element *EN = animations.find(E->get().normal_name); - if (p_idx >= EN->get().frames.size()) + if (!EN || p_idx >= EN->get().frames.size()) return Ref(); return EN->get().frames[p_idx];