diff --git a/MacPass/MPEntryContextMenuDelegate.m b/MacPass/MPEntryContextMenuDelegate.m index 2f54517f..e9312fab 100644 --- a/MacPass/MPEntryContextMenuDelegate.m +++ b/MacPass/MPEntryContextMenuDelegate.m @@ -46,9 +46,10 @@ static NSUInteger const kMPAttachmentsMenuItem = 2000; if([lastItem isSeparatorItem]) { [menu removeItem:lastItem]; } - MPDocument *document = [[NSDocumentController sharedDocumentController] currentDocument]; - - KPKEntry *entry = document.selectedEntry; + /* since we can get opend on the non-selected entry, we have to resolve the target node */ + id entryResolver = [NSApp targetForAction:@selector(currentTargetEntry)]; + KPKEntry *entry = [entryResolver currentTargetEntry]; + if([entry.customAttributes count] > 0) { [menu addItem:[NSMenuItem separatorItem]]; NSMenuItem *attributeItem = [[NSMenuItem alloc] init];