diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-03-13 12:17:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 12:17:53 +0100 |
commit | 18d543d7ab2a362e39cf45d7d4c44c188b60dac9 (patch) | |
tree | e6f40fb380c7498a5cf53147a113fac6e848b88d /editor/editor_export.cpp | |
parent | 88c1430613f2bba5551b345ab07df23869af815e (diff) | |
parent | 0876502f7288a6d4e4bfb58f8692db3516bebb7c (diff) |
Merge pull request #17311 from marcelofg55/export_err_checks
Improved error checking at EditorExportPlatformPC::export_project
Diffstat (limited to 'editor/editor_export.cpp')
-rw-r--r-- | editor/editor_export.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index da4bbf9b7a..7456cc902a 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1352,27 +1352,24 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = da->copy(template_path, p_path, get_chmod_flags()); - memdelete(da); - - if (err != OK) { - return err; - } - - String pck_path = p_path.get_basename() + ".pck"; + if (err == OK) { + String pck_path = p_path.get_basename() + ".pck"; - Vector<SharedObject> so_files; + Vector<SharedObject> so_files; - err = save_pack(p_preset, pck_path, &so_files); + err = save_pack(p_preset, pck_path, &so_files); - if (err != OK || so_files.empty()) - return err; - //if shared object files, copy them - da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - for (int i = 0; i < so_files.size(); i++) { - da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file())); + if (err == OK && !so_files.empty()) { + //if shared object files, copy them + da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + for (int i = 0; i < so_files.size() && err == OK; i++) { + err = da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file())); + } + } } + memdelete(da); - return OK; + return err; } void EditorExportPlatformPC::set_extension(const String &p_extension, const String &p_feature_key) { |