diff --git a/MacPass/ContextBar.xib b/MacPass/ContextBar.xib index 3027e81a..8702e8d8 100644 --- a/MacPass/ContextBar.xib +++ b/MacPass/ContextBar.xib @@ -158,6 +158,9 @@ + + + diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 940710bd..b08dc029 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -313,13 +313,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (KPKGroup *)trash { - static KPKGroup *_trash = nil; + /* Caching is dangerous, as we might have deleted the trashcan */ if(self.useTrash) { - BOOL trashValid = [_trash.uuid isEqual:self.tree.metaData.recycleBinUuid]; - if(!trashValid) { - _trash = [self findGroup:self.tree.metaData.recycleBinUuid]; - } - return _trash; + return [self findGroup:self.tree.metaData.recycleBinUuid]; } return nil; } @@ -329,12 +325,8 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (KPKGroup *)templates { - static KPKGroup *_templates = nil; - BOOL templateValid = [_templates.uuid isEqual:self.tree.metaData.entryTemplatesGroup]; - if(!templateValid) { - _templates = [self findGroup:self.tree.metaData.entryTemplatesGroup]; - } - return _templates; + /* Caching is dangerous as we might have deleted the group */ + return [self findGroup:self.tree.metaData.entryTemplatesGroup]; } - (void)setTrash:(KPKGroup *)trash {