From ef67ba47127ca12b3f72b30bb83db8ea70c0ae9c Mon Sep 17 00:00:00 2001 From: PaulStets Date: Mon, 21 May 2018 11:06:12 +0300 Subject: [PATCH] Fixed NPE for RoutingContext --- OsmAnd/src/net/osmand/plus/resources/ResourceManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index b1e2d3d0ad..cd85fd9d15 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -957,7 +957,10 @@ public class ResourceManager { List readers = new ArrayList<>(fileReaders.size()); for(BinaryMapReaderResource r : fileReaders.values()) { if(r.isUseForRouting()) { - readers.add(r.getReader(BinaryMapReaderResourceType.ROUTING)); + BinaryMapIndexReader reader = r.getReader(BinaryMapReaderResourceType.ROUTING); + if (reader != null) { + readers.add(reader); + } } } return readers.toArray(new BinaryMapIndexReader[readers.size()]);