diff --git a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java index 7b8be26915..e66b307e2f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java @@ -52,10 +52,12 @@ public class NavigationFragment extends BaseSettingsFragment { SwitchPreferenceCompat turnScreenOn = (SwitchPreferenceCompat) findPreference(settings.TURN_SCREEN_ON_ENABLED.getId()); SwitchPreferenceEx animateMyLocation = (SwitchPreferenceEx) findPreference(settings.ANIMATE_MY_LOCATION.getId()); if (getSelectedAppMode().getRoutingProfile() != null) { - GeneralRouter gr = app.getRoutingConfig().getRouter(getSelectedAppMode().getRoutingProfile()); - RoutingProfilesResources routingProfilesResources = RoutingProfilesResources.valueOf(gr.getProfileName().toUpperCase()); - navigationType.setSummary(routingProfilesResources.getStringRes()); - navigationType.setIcon(getContentIcon(routingProfilesResources.getIconRes())); + GeneralRouter routingProfile = app.getRoutingConfig().getRouter(getSelectedAppMode().getRoutingProfile()); + if (routingProfile != null) { + RoutingProfilesResources routingProfilesResources = RoutingProfilesResources.valueOf(routingProfile.getProfileName().toUpperCase()); + navigationType.setSummary(routingProfilesResources.getStringRes()); + navigationType.setIcon(getContentIcon(routingProfilesResources.getIconRes())); + } } routeParameters.setIcon(getContentIcon(R.drawable.ic_action_route_distance)); showRoutingAlarms.setIcon(getContentIcon(R.drawable.ic_action_alert));