Explorar el Código

33714 Check if the image is null before use.

K. S. Ernest (iFire) Lee hace 5 años
padre
commit
5d70a95fe1
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      modules/assimp/import_utils.h

+ 2 - 0
modules/assimp/import_utils.h

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