forked from organicmaps/organicmaps
Merge pull request #5817 from igrechuhin/crash-fix
[crash-fix] [ios] Crash fix.
This commit is contained in:
commit
b8ca40ccd6
1 changed files with 19 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue