Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24067]:List view crash when deleting rows with "pruneSectionsOnEdit" set #8870

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions iphone/Classes/TiUIListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,12 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
[self fireEditEventWithName:@"delete" andSection:theSection atIndexPath:indexPath item:theItem];
[theItem release];

BOOL emptyTable = NO;
NSUInteger sectionCount = [[self.listViewProxy sectionCount] unsignedIntValue];
if ( sectionCount == 0) {
emptyTable = YES;
}

BOOL emptySection = NO;

if ([theSection itemCount] == 0) {
Expand All @@ -1120,13 +1126,7 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
[self.listViewProxy deleteSectionAtIndex:indexPath.section];
}
}

BOOL emptyTable = NO;
NSUInteger sectionCount = [[self.listViewProxy sectionCount] unsignedIntValue];
if ( sectionCount == 0) {
emptyTable = YES;
}


//Reload the data now.
[tableView beginUpdates];
if (emptyTable) {
Expand Down