[iOS] Fix crash when many bookmarks in the list (header cell with category isn't visible).

This commit is contained in:
vng 2012-10-19 01:38:26 +03:00 committed by Alex Zolotarev
parent 95e92382d5
commit f493f4ee90

View file

@ -328,8 +328,12 @@
[m_locationManager stop:self];
// Save possibly edited set name
UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
NSString * newName = ((UITextField *)[cell.contentView viewWithTag:TEXTFIELD_TAG]).text;
[self renameBMCategoryIfChanged:newName];
if (cell != nil)
{
NSString * newName = ((UITextField *)[cell.contentView viewWithTag:TEXTFIELD_TAG]).text;
[self renameBMCategoryIfChanged:newName];
}
[super viewWillDisappear:animated];
}