diff --git a/KeePassKit b/KeePassKit index 1b9226ec..1e2dead0 160000 --- a/KeePassKit +++ b/KeePassKit @@ -1 +1 @@ -Subproject commit 1b9226eca278fd6106bfda8d42163c1854c7fefe +Subproject commit 1e2dead025183eabc492c84b79dad3167728b9d9 diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 2837c193..64c84d15 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -250,7 +250,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { if(isUnlocked) { [[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidUnlockDatabaseNotification object:self]; /* Make sure to only store */ - if(self.compositeKey.hasPassword && self.isAllowedToStoreKeyFile) { + if(self.compositeKey.hasKeyFile && self.compositeKey.hasPassword && self.isAllowedToStoreKeyFile) { [self _storeKeyURL:keyFileURL]; } } @@ -565,6 +565,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (void)_storeKeyURL:(NSURL *)keyURL { + if(nil == keyURL) { + return; // no URL to store in the first place + } NSAssert(self.isAllowedToStoreKeyFile, @"We can only store if we are allowed to do so!"); NSMutableDictionary *keysForFiles = [[[NSUserDefaults standardUserDefaults] dictionaryForKey:kMPSettingsKeyRememeberdKeysForDatabases] mutableCopy]; if(nil == keysForFiles) {