33714 Check if the image is null before use.

This commit is contained in:
K. S. Ernest (iFire) Lee 2019-11-20 11:22:27 -08:00
parent 3b44866bf2
commit 5d70a95fe1

View file

@ -394,7 +394,9 @@ public:
return Ref<Image>(); return Ref<Image>();
} else { } else {
Ref<Texture> texture = ResourceLoader::load(p_path); Ref<Texture> texture = ResourceLoader::load(p_path);
ERR_FAIL_COND_V(texture.is_null(), Ref<Image>());
Ref<Image> image = texture->get_data(); Ref<Image> image = texture->get_data();
ERR_FAIL_COND_V(image.is_null(), Ref<Image>());
state.path_to_image_cache.insert(p_path, image); state.path_to_image_cache.insert(p_path, image);
return image; return image;
} }