From fd24868714824a739250ab2c2749cc5b4ee8b43a Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 7 Mar 2019 11:10:44 +0200 Subject: [PATCH] Fix #6614 --- .../AvoidRoadsBottomSheetDialogFragment.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java index be7c2c0140..1cd3c6223f 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java @@ -193,14 +193,19 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr } private void populateImpassableRoadsTypes() { - Context context = getContext(); - if (context == null) { + OsmandApplication app = getMyApplication(); + if (app == null) { return; } for (Map.Entry entry : routingParametersMap.entrySet()) { final String parameterId = entry.getKey(); boolean selected = entry.getValue(); - String parameterName = SettingsBaseActivity.getRoutingStringPropertyName(context, parameterId, ""); + GeneralRouter.RoutingParameter parameter = app.getRoutingOptionsHelper().getRoutingPrefsForAppModeById(app.getRoutingHelper().getAppMode(), parameterId); + String defValue = ""; + if (parameter != null) { + defValue = parameter.getName(); + } + String parameterName = SettingsBaseActivity.getRoutingStringPropertyName(app, parameterId, defValue); final BottomSheetItemWithCompoundButton[] item = new BottomSheetItemWithCompoundButton[1]; item[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()