Buggy code:
public class MapRoutePreferencesControl { private OsmandSettings settings ; private Dialog dialog ; private ArrayAdapter < MapRoutePreferencesControl . LocalRoutingParameter > listAdapter ; private MapActivity mapActivity ; public MapRoutePreferencesControl ( MapActivity mapActivity ) { } private static class LocalRoutingParameter { public RoutingParameter routingParameter ; public String getText ( MapActivity mapActivity ) { } public boolean isSelected ( OsmandSettings settings ) { } public void setSelected ( OsmandSettings settings , boolean isChecked ) { } } private static class OtherLocalRoutingParameter extends MapRoutePreferencesControl . LocalRoutingParameter { public String text ; public boolean selected ; public int id ; public OtherLocalRoutingParameter ( int id , String text , boolean selected ) { } @ Override public String getText ( MapActivity mapActivity ) { } @ Override public boolean isSelected ( OsmandSettings settings ) { } @ Override public void setSelected ( OsmandSettings settings , boolean isChecked ) { } } public void showAndHideDialog ( ) { } private Dialog showDialog ( ) { } private void updateGpxRoutingParameter ( MapRoutePreferencesControl . OtherLocalRoutingParameter gpxParam ) { } private List < MapRoutePreferencesControl . LocalRoutingParameter > getRoutingParameters ( ApplicationMode am ) { List < MapRoutePreferencesControl . LocalRoutingParameter > list = new ArrayList < MapRoutePreferencesControl . LocalRoutingParameter > ( ) ; GPXRouteParamsBuilder rparams = mapActivity . getRoutingHelper ( ) . getCurrentGPXRoute ( ) ; boolean osmandRouter = ( settings . ROUTER_SERVICE . get ( ) ) == ( RouteService . OSMAND ) ; if ( ! osmandRouter ) { list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . calculate_osmand_route_without_internet , getString ( calculate_osmand_route_without_internet ) , settings . GPX_ROUTE_CALC_OSMAND_PARTS . get ( ) ) ) ; list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . fast_route_mode , getString ( fast_route_mode ) , settings . FAST_ROUTE_MODE . get ( ) ) ) ; return list ; } if ( rparams != null ) { GPXFile fl = rparams . getFile ( ) ; if ( fl . hasRtePt ( ) ) { list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . use_points_as_intermediates , getString ( use_points_as_intermediates ) , rparams . isUseIntermediatePointsRTE ( ) ) ) ; } list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . gpx_option_reverse_route , getString ( gpx_option_reverse_route ) , rparams . isReverse ( ) ) ) ; if ( ! ( rparams . isUseIntermediatePointsRTE ( ) ) ) { list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . gpx_option_from_start_point , getString ( gpx_option_from_start_point ) , rparams . isPassWholeRoute ( ) ) ) ; list . add ( new MapRoutePreferencesControl . OtherLocalRoutingParameter ( string . gpx_option_calculate_first_last_segment , getString ( gpx_option_calculate_first_last_segment ) , rparams . isCalculateOsmAndRouteParts ( ) ) ) ; } } GeneralRouter rm = SettingsNavigationActivity . getRouter ( mapActivity . getMyApplication ( ) . getDefaultRoutingConfig ( ) , am ) ; <START_BUG> if ( ( rm == null ) || ( ( rparams != null ) && ( ! ( rparams . isCalculateOsmAndRoute ( ) ) ) ) ) { <END_BUG> return list ; } for ( RoutingParameter r : rm . getParameters ( ) . values ( ) ) { if ( ( r . getType ( ) ) == ( RoutingParameterType . BOOLEAN ) ) { MapRoutePreferencesControl . LocalRoutingParameter rp = new MapRoutePreferencesControl . LocalRoutingParameter ( ) ; rp . routingParameter = r ; list . add ( rp ) ; } } return list ; } private String getString ( int id ) { } private View createLayout ( ) { } private void setAvoidRoads ( ImageView avoidRoads ) { } private void setMuteBtn ( final ImageView muteBtn ) { } private void updateParameters ( ) { } private void setupSpinner ( View settingsDlg ) { } protected void openGPXFileSelection ( final Spinner gpxSpinner ) { } private void updateSpinnerItems ( Spinner gpxSpinner ) { } }

Fix:
if ( ( rm == null ) || ( ( ( rparams != null ) && ( ! ( rparams . isCalculateOsmAndRoute ( ) ) ) ) && ( ! ( rparams . getFile ( ) . hasRtePt ( ) ) ) ) ) {