From 54143ac26e806d290632d4ac6408a5a14f71c1da Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Fri, 11 Aug 2017 11:32:47 +0300 Subject: [PATCH] [fix] [ios] Workaround for reload with outdated SearchIndex. --- .../Maps/UI/Search/TableView/MWMSearchTableViewController.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm index 214e485a28..827d128648 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm @@ -82,6 +82,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + if ([MWMSearch resultsCount] == 0) + { + NSAssert(false, @"Invalid reload with outdated SearchIndex"); + return [tableView dequeueReusableCellWithCellClass:[MWMSearchCommonCell class] indexPath:indexPath]; + } auto const row = indexPath.row; auto const containerIndex = [MWMSearch containerIndexWithRow:row]; switch ([MWMSearch resultTypeWithRow:row])