From b95f57d050bb60e5d514102a3c6a44d3373bce76 Mon Sep 17 00:00:00 2001 From: Benjamin Dahse Date: Tue, 20 Jun 2017 00:14:32 +0200 Subject: Add null-check to get_normal_frame --- scene/2d/animated_sprite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::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]; -- cgit v1.2.3