diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 9d4676ef01..0efff05ab7 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -2244,6 +2244,8 @@ Error EditorExportPlatform::save_zip(const Ref &p_preset, bo Error err = export_project_files(p_preset, p_debug, p_save_func, nullptr, &zd, _zip_add_shared_object); if (err != OK && err != ERR_SKIP) { add_message(EXPORT_MESSAGE_ERROR, TTR("Save ZIP"), TTR("Failed to export project files.")); + zipClose(zip, nullptr); + return err; } zipClose(zip, nullptr); @@ -2260,6 +2262,7 @@ Error EditorExportPlatform::save_zip(const Ref &p_preset, bo if (err != OK) { da->remove(tmppath); add_message(EXPORT_MESSAGE_ERROR, TTR("Save ZIP"), vformat(TTR("Failed to move temporary file \"%s\" to \"%s\"."), tmppath, p_path)); + return err; } return OK;