Fixed wrong assertion in index check preventing the first deletion of fist custom attribute (fixes #911)

This commit is contained in:
Michael Starke
2019-03-31 15:01:41 +02:00
parent 3dedbc1f68
commit c72566d4c1

View File

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