From cd544fd86b0aca99bf31e6f0e3a248d3e4195d49 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Wed, 7 Sep 2022 14:21:34 -0700 Subject: Fix issue causing the project manager to crash because of missing path argument In the process, the initialization logic is updated to show an error message and gracefully close the engine when setup errors occur. --- editor/editor_node.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'editor/editor_node.cpp') diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a2231f4601..6b5e982067 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3256,8 +3256,12 @@ void EditorNode::_discard_changes(const String &p_str) { for (const String &a : Main::get_forwardable_cli_arguments(Main::CLI_SCOPE_TOOL)) { args.push_back(a); } - args.push_back("--path"); - args.push_back(exec.get_base_dir()); + + String exec_base_dir = exec.get_base_dir(); + if (!exec_base_dir.is_empty()) { + args.push_back("--path"); + args.push_back(exec_base_dir); + } args.push_back("--project-manager"); Error err = OS::get_singleton()->create_instance(args); -- cgit v1.2.3