From 37fdd656c0d874ae84a1987fb37ffa5ca69116dd Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Wed, 16 Jun 2021 16:13:36 -0700 Subject: [PATCH] ERR_FAIL_NULL check file access Null in ResourceImporterTexture::_save_stex (cherry picked from commit b74bc42a4304be631936ad7fac5d1605a93ab759) --- editor/import/resource_importer_texture.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 1fe54253ae2..d4cc1682b0e 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -210,6 +210,7 @@ void ResourceImporterTexture::get_import_options(List *r_options, void ResourceImporterTexture::_save_stex(const Ref &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_force_po2_for_compressed) { FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE); + ERR_FAIL_NULL(f); f->store_8('G'); f->store_8('D'); f->store_8('S');