(fix) sanity check when no defaults are found (fixes #4179)

pull/228/merge
Ludovic Marcotte 2017-05-30 14:44:43 -04:00
parent f87797d61e
commit 9dae52a719
1 changed files with 4 additions and 1 deletions

View File

@ -62,8 +62,8 @@
- (NSString *) processDefaults: (BOOL)allDefaults
{
NSUserDefaults *ud;
NSDictionary *defaultsDict;
NSUserDefaults *ud;
NSData *plistData;
ud = [NSUserDefaults standardUserDefaults];
@ -78,6 +78,9 @@
defaultsDict = [ud persistentDomainForName: @"sogod"];
}
if (!defaultsDict)
return @"No defaults found. Try to use -f.";
plistData = [NSPropertyListSerialization dataFromPropertyList: (id) defaultsDict
format: NSPropertyListOpenStepFormat
errorDescription: 0 ];