From 738d5c55db6f5e691e4681ee43dfc551b805e7c1 Mon Sep 17 00:00:00 2001 From: michael starke Date: Mon, 8 Dec 2014 21:24:22 +0100 Subject: [PATCH] Fixed issue with entry context menu displaying wrong attachments and custom attributes --- MacPass/MPEntryContextMenuDelegate.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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];