diff options
author | Ilya Grechuhin <i.grechuhin@gmail.com> | 2016-03-18 11:13:22 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:56:53 +0300 |
commit | cbd17be9704c6a322388b47442875384ce458090 (patch) | |
tree | c15861ae6709d619965d9f782d0e0c0e8685b304 | |
parent | 8215646b682f95ec0fed963abbb2c817cb821f90 (diff) |
[ios] Fixed download all crash.
-rw-r--r-- | iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm index 16a7f23b1f..d0c91d5291 100644 --- a/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm +++ b/iphone/Maps/Classes/MapDownloader/DataSources/MWMMapDownloaderDefaultDataSource.mm @@ -90,14 +90,16 @@ using namespace storage; return; [availableCountriesBeforeUpdate enumerateKeysAndObjectsUsingBlock:^(NSString * key, NSArray<NSString *> * obj, BOOL * stop) { - NSArray<NSString *> * sectionCountries = self.availableCountries[key]; - if (!sectionCountries) + NSUInteger const sectionIndex = [self.indexes indexOfObject:key]; + if (sectionIndex == NSNotFound) { self.needFullReload = YES; *stop = YES; } - if (obj.count != sectionCountries.count) - [self.reloadSections addIndex:[self.indexes indexOfObject:key]]; + else if (obj.count != self.availableCountries[key].count) + { + [self.reloadSections addIndex:sectionIndex]; + } }]; [self.reloadSections shiftIndexesStartingAtIndex:0 by:self.downloadedSectionShift]; if (downloadedCountriesCountBeforeUpdate != downloadedCountriesCountAfterUpdate) |