diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index fd83138b14..730377cb25 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -135,7 +135,7 @@ public class GeneralRouter implements VehicleRouter { for (int i = 0; i < objectAttributes.length; i++) { objectAttributes[i] = new RouteAttributeContext(parent.objectAttributes[i], params); } - allowPrivate = params.containsKey(ALLOW_PRIVATE) && parseSilentBoolean(params.get(ALLOW_PRIVATE), false); + allowPrivate = params.containsKey(ALLOW_PRIVATE) && parseSilentBoolean(params.get(ALLOW_PRIVATE), false) ; shortestRoute = params.containsKey(USE_SHORTEST_WAY) && parseSilentBoolean(params.get(USE_SHORTEST_WAY), false); heightObstacles = params.containsKey(USE_HEIGHT_OBSTACLES) && parseSilentBoolean(params.get(USE_HEIGHT_OBSTACLES), false); if(shortestRoute) { diff --git a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java index 1e1cfe709b..71287f84a2 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java @@ -114,7 +114,8 @@ public class RoutePlannerFrontEnd { private boolean needRequestPrivateAccessRouting(RoutingContext ctx, List points) throws IOException { boolean res = false; GeneralRouter router = (GeneralRouter) ctx.getRouter(); - if (router != null && !router.isAllowPrivate()) { + if (router != null && !router.isAllowPrivate() && + router.getParameters().containsKey(GeneralRouter.ALLOW_PRIVATE)) { ctx.unloadAllData(); LinkedHashMap mp = new LinkedHashMap(); mp.put(GeneralRouter.ALLOW_PRIVATE, "true");