From c56058fe9a658eed8fd001bef6fc06a17aeeb708 Mon Sep 17 00:00:00 2001 From: bitsawer Date: Tue, 21 Feb 2023 16:58:55 +0200 Subject: Fix FileAccess last open error flag update --- core/io/file_access.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index 0e9084de84..3d10151327 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -133,8 +133,8 @@ Ref FileAccess::open_encrypted(const String &p_path, ModeFlags p_mod Ref fae; fae.instantiate(); Error err = fae->open_and_parse(fa, p_key, (p_mode_flags == WRITE) ? FileAccessEncrypted::MODE_WRITE_AES256 : FileAccessEncrypted::MODE_READ); + last_file_open_error = err; if (err) { - last_file_open_error = err; return Ref(); } return fae; @@ -149,8 +149,8 @@ Ref FileAccess::open_encrypted_pass(const String &p_path, ModeFlags Ref fae; fae.instantiate(); Error err = fae->open_and_parse_password(fa, p_pass, (p_mode_flags == WRITE) ? FileAccessEncrypted::MODE_WRITE_AES256 : FileAccessEncrypted::MODE_READ); + last_file_open_error = err; if (err) { - last_file_open_error = err; return Ref(); } return fae; @@ -161,9 +161,8 @@ Ref FileAccess::open_compressed(const String &p_path, ModeFlags p_mo fac.instantiate(); fac->configure("GCPF", (Compression::Mode)p_compress_mode); Error err = fac->open_internal(p_path, p_mode_flags); - + last_file_open_error = err; if (err) { - last_file_open_error = err; return Ref(); } -- cgit v1.2.3