mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a possible uncaught exception in ConsoleApplication
This commit is contained in:
parent
3064d243b0
commit
11aee7cb6a
1 changed files with 8 additions and 5 deletions
|
|
@ -219,7 +219,6 @@ String ArgumentList::getValueForOption (StringRef option) const
|
|||
}
|
||||
|
||||
return {};
|
||||
|
||||
}
|
||||
|
||||
String ArgumentList::removeValueForOption (StringRef option)
|
||||
|
|
@ -334,11 +333,15 @@ const ConsoleApplication::Command* ConsoleApplication::findCommand (const Argume
|
|||
|
||||
int ConsoleApplication::findAndRunCommand (const ArgumentList& args, bool optionMustBeFirstArg) const
|
||||
{
|
||||
if (auto c = findCommand (args, optionMustBeFirstArg))
|
||||
return invokeCatchingFailures ([&args, c] { c->command (args); return 0; });
|
||||
return invokeCatchingFailures ([&args, optionMustBeFirstArg, this]
|
||||
{
|
||||
if (auto c = findCommand (args, optionMustBeFirstArg))
|
||||
c->command (args);
|
||||
else
|
||||
fail ("Unrecognised arguments");
|
||||
|
||||
fail ("Unrecognised arguments");
|
||||
return 0;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
int ConsoleApplication::findAndRunCommand (int argc, char* argv[]) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue