From c72566d4c1c87c89c777fa927e25181de5b88605 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Sun, 31 Mar 2019 15:01:41 +0200 Subject: [PATCH] Fixed wrong assertion in index check preventing the first deletion of fist custom attribute (fixes #911) --- MacPass/MPEntryInspectorViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index b256e4df..ec49f3b2 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -201,7 +201,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { } - (void)removeCustomField:(id)sender { NSInteger rowIndex = [self.customFieldsTableView rowForView:sender]; - NSAssert(rowIndex > 0 && rowIndex < self.representedEntry.customAttributes.count, @"Invalid custom attribute index."); + NSAssert(rowIndex >= 0 && rowIndex < self.representedEntry.customAttributes.count, @"Invalid custom attribute index."); KPKAttribute *attribute = self.representedEntry.customAttributes[rowIndex]; [self.observer willChangeModelProperty]; [self.representedEntry removeCustomAttribute:attribute];