From 249875fb7f3595c712edefbc4488db395efa18f4 Mon Sep 17 00:00:00 2001 From: michael starke Date: Thu, 4 Dec 2014 02:00:03 +0100 Subject: [PATCH] Fixed isse with entries being added while no group is selected. --- MacPass/MPEntryViewController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 5a3d8148..f1c46357 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -403,7 +403,14 @@ NSString *const _MPTableSecurCellView = @"PasswordCell"; - (void)_didAddItem:(NSNotification *)notification { MPDocument *document = [[self windowController] document]; + if(!document.selectedGroup) { + /* TODO: show group? */ + return; // No group selected + } KPKEntry *entry = document.selectedGroup.entries.lastObject; + if(!entry) { + return; // No Entry found, nothing to select. + } NSUInteger row = [self.entryArrayController.arrangedObjects indexOfObject:entry]; [self.entryTable scrollRowToVisible:row]; [self.entryTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];