diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-05 17:44:07 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-05 17:44:07 +0200 |
commit | d8e2a2b86051fdf02ec7d0e83d330a7f536878aa (patch) | |
tree | 9bdde1d1451ed98c41f45e1c8e4419642a5460f9 /main | |
parent | 4e6d96299df42337c45df6f1c3dd642ed86284b9 (diff) | |
parent | 1d099704049b2bfaac3680758dbdd163be0355f5 (diff) | |
download | redot-engine-d8e2a2b86051fdf02ec7d0e83d330a7f536878aa.tar.gz |
Merge pull request #95005 from jsjtxietian/export-proj
Fix crash or unclear messages when exporting with invalid arguments
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index db5e6ec398..1af08bc036 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -3548,13 +3548,16 @@ int Main::start() { gdscript_docs_path = E->next()->get(); #endif } else if (E->get() == "--export-release") { + ERR_FAIL_COND_V_MSG(!editor && !found_project, EXIT_FAILURE, "Please provide a valid project path when exporting, aborting."); editor = true; //needs editor _export_preset = E->next()->get(); } else if (E->get() == "--export-debug") { + ERR_FAIL_COND_V_MSG(!editor && !found_project, EXIT_FAILURE, "Please provide a valid project path when exporting, aborting."); editor = true; //needs editor _export_preset = E->next()->get(); export_debug = true; } else if (E->get() == "--export-pack") { + ERR_FAIL_COND_V_MSG(!editor && !found_project, EXIT_FAILURE, "Please provide a valid project path when exporting, aborting."); editor = true; _export_preset = E->next()->get(); export_pack_only = true; @@ -3566,6 +3569,8 @@ int Main::start() { if (parsed_pair) { E = E->next(); } + } else if (E->get().begins_with("--export-")) { + ERR_FAIL_V_MSG(EXIT_FAILURE, "Missing export preset name, aborting."); } #ifdef TOOLS_ENABLED // Handle case where no path is given to --doctool. @@ -4409,7 +4414,7 @@ bool Main::iteration() { } #ifdef TOOLS_ENABLED - if (wait_for_import && EditorFileSystem::get_singleton()->doing_first_scan()) { + if (wait_for_import && EditorFileSystem::get_singleton() && EditorFileSystem::get_singleton()->doing_first_scan()) { exit = false; } #endif |