Add check for appModeKey

This commit is contained in:
Vitaliy 2020-02-19 12:53:00 +02:00
parent 1b9fbc5792
commit a0342f9548

View file

@ -231,10 +231,8 @@ public class AvoidSpecificRoads {
ll.setLongitude(loc.getLongitude()); ll.setLongitude(loc.getLongitude());
ApplicationMode defaultAppMode = app.getRoutingHelper().getAppMode(); ApplicationMode defaultAppMode = app.getRoutingHelper().getAppMode();
final ApplicationMode appMode = ApplicationMode.valueOfStringKey(appModeKey, defaultAppMode); final ApplicationMode appMode = appModeKey != null ? ApplicationMode.valueOfStringKey(appModeKey, defaultAppMode) : defaultAppMode;
if (appMode == null) {
return;
}
List<RouteSegmentResult> roads = app.getRoutingHelper().getRoute().getOriginalRoute(); List<RouteSegmentResult> roads = app.getRoutingHelper().getRoute().getOriginalRoute();
if (mapActivity != null && roads != null) { if (mapActivity != null && roads != null) {
RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox().copy(); RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox().copy();