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];