summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorBenjamin Dahse <ronoueb@gmail.com>2017-06-20 00:14:32 +0200
committerBenjamin Dahse <ronoueb@gmail.com>2017-06-20 00:37:34 +0200
commitb95f57d050bb60e5d514102a3c6a44d3373bce76 (patch)
tree171d4158552bdf0c7c1610feaa91b4622ff20edf /scene/2d
parentb6b225f4c5c3a9b91cc9ae8e9e283b0dd31a54cd (diff)
Add null-check to get_normal_frame
Diffstat (limited to 'scene/2d')
-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];