summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2021-06-16 16:13:36 -0700
committerK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2021-06-16 16:13:36 -0700
commitb74bc42a4304be631936ad7fac5d1605a93ab759 (patch)
tree57af6f1e569b2f9832f679d16ef0b81613f00ddc /editor
parent341cb8da311698d685b390524d0f20795f1774d7 (diff)
ERR_FAIL_NULL check file access
Null in ResourceImporterTexture::_save_stex
Diffstat (limited to 'editor')
-rw-r--r--editor/import/resource_importer_texture.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 809f47bad9..72df65a787 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -308,6 +308,7 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref<Image
void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String &p_to_path, CompressMode p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, bool p_streamable, bool p_detect_3d, bool p_detect_roughness, bool p_detect_normal, bool p_force_normal, bool p_srgb_friendly, bool p_force_po2_for_compressed, uint32_t p_limit_mipmap, const Ref<Image> &p_normal, Image::RoughnessChannel p_roughness_channel) {
FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE);
+ ERR_FAIL_NULL(f);
f->store_8('G');
f->store_8('S');
f->store_8('T');