Fix impassable layer crash

This commit is contained in:
Alexey Kulish 2016-11-18 14:24:21 +03:00
parent b60b263950
commit 4d2148ff56

View file

@ -169,11 +169,13 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements
for (RouteDataObject road : getMissingRoads()) {
Location location = getMissingRoadLocations().get(road.getId());
int x = (int) tileBox.getPixXFromLatLon(location.getLatitude(), location.getLongitude());
int y = (int) tileBox.getPixYFromLatLon(location.getLatitude(), location.getLongitude());
if (calculateBelongs(ex, ey, x, y, compare)) {
compare = radius;
o.add(road);
if (location != null) {
int x = (int) tileBox.getPixXFromLatLon(location.getLatitude(), location.getLongitude());
int y = (int) tileBox.getPixYFromLatLon(location.getLatitude(), location.getLongitude());
if (calculateBelongs(ex, ey, x, y, compare)) {
compare = radius;
o.add(road);
}
}
}
}