From afff54d64749e0cc028835cf0e7cd4e2bb2820dd Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Sun, 16 Oct 2016 17:01:58 +0200 Subject: [PATCH] At application start make sure StartAtLogin default configuration exists, else the Preferences window will assert because of Nil value on setStringValue --- syncthing/STApplication.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/syncthing/STApplication.m b/syncthing/STApplication.m index 5ee3475..0c3fb86 100644 --- a/syncthing/STApplication.m +++ b/syncthing/STApplication.m @@ -65,6 +65,11 @@ } else { [_syncthing setApiKey:cfgApiKey]; } + + NSString *cfgStartAtLogin = [defaults stringForKey:@"StartAtLogin"]; + if (!cfgStartAtLogin) { + [defaults setObject:@"false" forKey:@"StartAtLogin"]; + } } - (void) sendNotification:(NSString *)text {