Merge pull request #5817 from igrechuhin/crash-fix

[crash-fix] [ios] Crash fix.
This commit is contained in:
Vlad Mihaylenko 2017-04-12 15:16:10 +03:00 committed by GitHub
commit b8ca40ccd6

View file

@ -201,9 +201,12 @@ map<MetainfoRows, Class> 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<MetainfoRows, Class> 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<MetainfoRows, Class> const kMetaInfoCells = {
using namespace place_page;
auto data = self.data;
if (!data)
return [tableView dequeueReusableCellWithCellClass:[UITableViewCell class] indexPath:indexPath];
id<MWMPlacePageButtonsProtocol> delegate = self.delegate;
switch (data.sections[indexPath.section])
{
@ -476,7 +483,8 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
- (void)update
{
[self.placePageView.tableView refresh];
if (self.data)
[self.placePageView.tableView refresh];
}
#pragma mark - MWMPlacePageViewUpdateProtocol
@ -493,4 +501,12 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
[self.layoutImpl onUpdatePlacePageWithHeight:self.placePageView.tableView.contentSize.height];
}
#pragma mark - Properties
- (void)setData:(MWMPlacePageData *)data
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];
_data = data;
}
@end