From b1681ff2d541a8fa87a7b1f10e6903abd201405c Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 12 Apr 2017 14:39:40 +0300 Subject: [PATCH] [crash-fix] [ios] Crash fix. https://fabric.io/mapsme/ios/apps/com.mapswithme.full/issues/58e7bc8f0aeb16625b5e70cf --- .../PlacePage/PlacePageLayout/MWMPlacePageLayout.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm index 8f7f92a2f1..ba7ce90984 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.mm @@ -201,9 +201,12 @@ map const kMetaInfoCells = { - (void)processDownloaderEventWithStatus:(storage::NodeStatus)status progress:(CGFloat)progress { - using namespace storage; + auto data = self.data; + if (!data) + return; - auto const & sections = self.data.sections; + using namespace storage; + auto const & sections = data.sections; switch (status) { case NodeStatus::OnDiskOutOfDate: @@ -301,6 +304,8 @@ map const kMetaInfoCells = { using namespace place_page; auto data = self.data; + if (!data) + return 0; switch (data.sections[section]) { case Sections::Bookmark: return 1; @@ -320,6 +325,8 @@ map const kMetaInfoCells = { using namespace place_page; auto data = self.data; + if (!data) + return [tableView dequeueReusableCellWithCellClass:[UITableViewCell class] indexPath:indexPath]; id delegate = self.delegate; switch (data.sections[indexPath.section]) {