1
0
Fork 0

Fix crash on first-run on macOS

This commit is contained in:
James Turner 2020-05-25 14:13:21 +01:00
parent 1a94f4858b
commit 0423524b82

View file

@ -2103,6 +2103,13 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
// first, process the command line
bool inOptions = true;
for (int i=1; i<argc; ++i) {
// important : on first run after the Gatekeeper quarantine flag is
// cleared, launchd passes us a null argument here. Avoid dying in
// that case.
if (!argv[i]) {
continue;
}
if (inOptions && (argv[i][0] == '-')) {
if (strcmp(argv[i], "--") == 0) { // end of options delimiter
inOptions = false;