mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix segfault when entered command doesn't exist
This commit is contained in:
parent
424bb406c3
commit
942ea5be4b
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue