Skip to content

Commit

Permalink
(fix) sanity check when no defaults are found (fixes #4179)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed May 30, 2017
1 parent d7eb751 commit bbac466
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tools/SOGoToolDumpDefaults.m
Expand Up @@ -67,8 +67,8 @@ - (void) usage

- (NSString *) processDefaults: (BOOL)allDefaults
{
NSUserDefaults *ud;
NSDictionary *defaultsDict;
NSUserDefaults *ud;
NSData *plistData;

ud = [NSUserDefaults standardUserDefaults];
Expand All @@ -83,6 +83,9 @@ - (NSString *) processDefaults: (BOOL)allDefaults
defaultsDict = [ud persistentDomainForName: @"sogod"];
}

if (!defaultsDict)
return @"No defaults found. Try to use -f.";

plistData = [NSPropertyListSerialization dataFromPropertyList: (id) defaultsDict
format: NSPropertyListOpenStepFormat
errorDescription: 0 ];
Expand Down

0 comments on commit bbac466

Please sign in to comment.