summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/2d/animated_sprite.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h
index 2274450647..80defac079 100644
--- a/scene/2d/animated_sprite.h
+++ b/scene/2d/animated_sprite.h
@@ -99,7 +99,7 @@ public:
const Map<StringName, Anim>::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<Texture>();
return EN->get().frames[p_idx];