From 4d2148ff56c7b12b1d81217d2e5ecf42af45673c Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Fri, 18 Nov 2016 14:24:21 +0300 Subject: [PATCH] Fix impassable layer crash --- .../net/osmand/plus/views/ImpassableRoadsLayer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/ImpassableRoadsLayer.java b/OsmAnd/src/net/osmand/plus/views/ImpassableRoadsLayer.java index ce8dc2e4cf..1b93053e7e 100644 --- a/OsmAnd/src/net/osmand/plus/views/ImpassableRoadsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ImpassableRoadsLayer.java @@ -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); + } } } }