mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Fix segfault when entered command doesn't exist
This commit is contained in:
@@ -568,6 +568,12 @@ extern "C"
|
||||
argEnumerator.TryPop();
|
||||
|
||||
const CommandLineCommand * command = CommandLine::FindCommandFor(CommandLine::RootCommands, &argEnumerator);
|
||||
|
||||
if (command == nullptr)
|
||||
{
|
||||
return EXITCODE_FAIL;
|
||||
}
|
||||
|
||||
if (command->Options != nullptr)
|
||||
{
|
||||
auto argEnumeratorForOptions = CommandLineArgEnumerator(argEnumerator);
|
||||
@@ -576,6 +582,7 @@ extern "C"
|
||||
return EXITCODE_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (command == CommandLine::RootCommands && command->Func == nullptr)
|
||||
{
|
||||
return CommandLine::HandleCommandDefault();
|
||||
|
||||
Reference in New Issue
Block a user