From a0342f95482f7902229e03ddfc0fa7349b58c029 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 19 Feb 2020 12:53:00 +0200 Subject: [PATCH] Add check for appModeKey --- OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index e6c7ab9853..d724e0f9ce 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -231,10 +231,8 @@ public class AvoidSpecificRoads { ll.setLongitude(loc.getLongitude()); ApplicationMode defaultAppMode = app.getRoutingHelper().getAppMode(); - final ApplicationMode appMode = ApplicationMode.valueOfStringKey(appModeKey, defaultAppMode); - if (appMode == null) { - return; - } + final ApplicationMode appMode = appModeKey != null ? ApplicationMode.valueOfStringKey(appModeKey, defaultAppMode) : defaultAppMode; + List roads = app.getRoutingHelper().getRoute().getOriginalRoute(); if (mapActivity != null && roads != null) { RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox().copy();