Browse Source

Add null-check to get_normal_frame

Benjamin Dahse 8 years ago
parent
commit
b95f57d050
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/2d/animated_sprite.h

+ 1 - 1
scene/2d/animated_sprite.h

@@ -99,7 +99,7 @@ public:
 
 
 		const Map<StringName, Anim>::Element *EN = animations.find(E->get().normal_name);
 		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 Ref<Texture>();
 
 
 		return EN->get().frames[p_idx];
 		return EN->get().frames[p_idx];