summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-17 10:49:22 +0200
committerGitHub <noreply@github.com>2022-04-17 10:49:22 +0200
commit690fefe43ee74c0ae3ed5642f3aefbeb711f9d1c (patch)
treed174d6e8f06a60c2f3074fca81e080f3d910f7a2
parentf7ca732df19c968693d5d1300f54a88a71c1bf11 (diff)
parent0bff53135a7388d5604983e96610cbd47996d66c (diff)
Merge pull request #60310 from HookJabs/unz_file_read_failure
-rw-r--r--editor/export_template_manager.cpp8
-rw-r--r--editor/project_manager.cpp4
2 files changed, 3 insertions, 9 deletions
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index 06c179e77c..b34b08b5de 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -404,9 +404,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
// Read.
unzOpenCurrentFile(pkg);
ret = unzReadCurrentFile(pkg, data.ptrw(), data.size());
- if (ret != UNZ_OK) {
- break;
- }
+ ERR_BREAK_MSG(ret < 0, vformat("An error occurred while attempting to read from file: %s. This file will not be used.", file));
unzCloseCurrentFile(pkg);
String data_str;
@@ -478,9 +476,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
// Read
unzOpenCurrentFile(pkg);
ret = unzReadCurrentFile(pkg, data.ptrw(), data.size());
- if (ret != UNZ_OK) {
- break;
- }
+ ERR_BREAK_MSG(ret < 0, vformat("An error occurred while attempting to read from file: %s. This file will not be used.", file));
unzCloseCurrentFile(pkg);
String base_dir = file_path.get_base_dir().trim_suffix("/");
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 08b968edb6..4ca0f18f0e 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -557,9 +557,7 @@ private:
//read
unzOpenCurrentFile(pkg);
ret = unzReadCurrentFile(pkg, data.ptrw(), data.size());
- if (ret != UNZ_OK) {
- break;
- }
+ ERR_BREAK_MSG(ret < 0, vformat("An error occurred while attempting to read from file: %s. This file will not be used.", rel_path));
unzCloseCurrentFile(pkg);
Ref<FileAccess> f = FileAccess::open(dir.plus_file(rel_path), FileAccess::WRITE);