This commit is contained in:
Alexey Kulish 2016-11-11 15:56:36 +03:00
parent c3d692660c
commit 8e32731ce7
2 changed files with 23 additions and 16 deletions

View file

@ -384,8 +384,12 @@ public class OsmandRegions {
} }
public WorldRegion getRegionDataByDownloadName(String downloadName) { public WorldRegion getRegionDataByDownloadName(String downloadName) {
if (downloadName == null) {
return null;
} else {
return getRegionData(downloadNamesToFullNames.get(downloadName.toLowerCase())); return getRegionData(downloadNamesToFullNames.get(downloadName.toLowerCase()));
} }
}
public String getDownloadName(BinaryMapDataObject o) { public String getDownloadName(BinaryMapDataObject o) {
return mapIndexFields.get(mapIndexFields.downloadNameType, o); return mapIndexFields.get(mapIndexFields.downloadNameType, o);

View file

@ -538,7 +538,9 @@ public abstract class MenuController extends BaseMenuController {
String selectedFullName = ""; String selectedFullName = "";
double smallestArea = -1; double smallestArea = -1;
for (BinaryMapDataObject o : mapDataObjects) { for (BinaryMapDataObject o : mapDataObjects) {
boolean downloaded = checkIfObjectDownloaded(rm, osmandRegions.getDownloadName(o)); String downloadName = osmandRegions.getDownloadName(o);
if (!Algorithms.isEmpty(downloadName)) {
boolean downloaded = checkIfObjectDownloaded(rm, downloadName);
if (downloaded) { if (downloaded) {
downloadMapDataObject = null; downloadMapDataObject = null;
break; break;
@ -556,6 +558,7 @@ public abstract class MenuController extends BaseMenuController {
} }
} }
} }
}
downloaded = downloadMapDataObject == null; downloaded = downloadMapDataObject == null;
if (!downloaded) { if (!downloaded) {