2
0

Fixed some rare crashes.

[FIXED]     Crash for users with no name.
[FIXED]     Crash when copying an element with no content.
This commit is contained in:
Maarten Billemont 2012-09-20 21:16:34 +02:00
parent 27d0373a6e
commit 2a48c9d272
6 changed files with 14 additions and 6 deletions

2
External/Pearl vendored

@ -1 +1 @@
Subproject commit bf632ec1c6ec6a1b3037a0933cede0c64fae68a3 Subproject commit 4125775291e209a55991743c5c1c18f7fc590e14

View File

@ -16,8 +16,10 @@
static NSDictionary *keyQuery(MPUserEntity *user) { static NSDictionary *keyQuery(MPUserEntity *user) {
return [PearlKeyChain createQueryForClass:kSecClassGenericPassword return [PearlKeyChain createQueryForClass:kSecClassGenericPassword
attributes:@{(__bridge id)kSecAttrService: @"Saved Master Password", attributes:@{
(__bridge id)kSecAttrAccount: user.name} (__bridge id)kSecAttrService: @"Saved Master Password",
(__bridge id)kSecAttrAccount: IfNotNilElse(user.name, @"")
}
matches:nil]; matches:nil];
} }

View File

@ -485,11 +485,13 @@
- (IBAction)copyContent { - (IBAction)copyContent {
if (!self.activeElement) id content = self.activeElement.content;
if (!content)
// Nothing to copy.
return; return;
inf(@"Copying password for: %@", self.activeElement.name); inf(@"Copying password for: %@", self.activeElement.name);
[UIPasteboard generalPasteboard].string = [self.activeElement.content description]; [UIPasteboard generalPasteboard].string = [content description];
[self showContentTip:@"Copied!" withIcon:nil]; [self showContentTip:@"Copied!" withIcon:nil];

View File

@ -554,6 +554,10 @@
- (void)tryMasterPassword { - (void)tryMasterPassword {
if (!self.selectedUser)
// No user selected, can't try sign-in.
return;
[self setSpinnerActive:YES]; [self setSpinnerActive:YES];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{