From 9f40dfae42a204991f9cff88df25ab22447bb84b Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 17 Aug 2016 14:24:01 +0200 Subject: [PATCH] Fixed potention null-pointer derefencing --- MacPass/MPDocument.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 3fc0f73a..dfd787d0 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -152,7 +152,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey return YES; // key is set, so autosave should be save } NSDictionary *userInfo = @{ NSLocalizedDescriptionKey: NSLocalizedString(@"NO_PASSWORD_OR_KEY_SET", "") }; - *outError = [NSError errorWithDomain:MPErrorDomain code:0 userInfo:userInfo]; + if(outError != NULL) { + *outError = [NSError errorWithDomain:MPErrorDomain code:0 userInfo:userInfo]; + } return NO; }