Add null-check to get_normal_frame

This commit is contained in:
Benjamin Dahse 2017-06-20 00:14:32 +02:00
parent b6b225f4c5
commit b95f57d050

View file

@ -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];