mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 18:42:24 +00:00
Fixed error that resulted in always trying to save a key file even if none was used
This commit is contained in:
Submodule KeePassKit updated: 1b9226eca2...1e2dead025
@@ -250,7 +250,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
|||||||
if(isUnlocked) {
|
if(isUnlocked) {
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidUnlockDatabaseNotification object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidUnlockDatabaseNotification object:self];
|
||||||
/* Make sure to only store */
|
/* Make sure to only store */
|
||||||
if(self.compositeKey.hasPassword && self.isAllowedToStoreKeyFile) {
|
if(self.compositeKey.hasKeyFile && self.compositeKey.hasPassword && self.isAllowedToStoreKeyFile) {
|
||||||
[self _storeKeyURL:keyFileURL];
|
[self _storeKeyURL:keyFileURL];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -565,6 +565,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)_storeKeyURL:(NSURL *)keyURL {
|
- (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!");
|
NSAssert(self.isAllowedToStoreKeyFile, @"We can only store if we are allowed to do so!");
|
||||||
NSMutableDictionary *keysForFiles = [[[NSUserDefaults standardUserDefaults] dictionaryForKey:kMPSettingsKeyRememeberdKeysForDatabases] mutableCopy];
|
NSMutableDictionary *keysForFiles = [[[NSUserDefaults standardUserDefaults] dictionaryForKey:kMPSettingsKeyRememeberdKeysForDatabases] mutableCopy];
|
||||||
if(nil == keysForFiles) {
|
if(nil == keysForFiles) {
|
||||||
|
|||||||
Reference in New Issue
Block a user