Skip to content

Commit

Permalink
Fixes godot crash or give unclear message when exporting with invalid…
Browse files Browse the repository at this point in the history
… args
  • Loading branch information
jsjtxietian committed Sep 5, 2024
1 parent 7c38376 commit 1d09970
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3546,13 +3546,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;
Expand All @@ -3564,6 +3567,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.
Expand Down Expand Up @@ -4407,7 +4412,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
Expand Down

0 comments on commit 1d09970

Please sign in to comment.