Fix possible npe with general router
This commit is contained in:
parent
638489fcdf
commit
0083b7d0e1
1 changed files with 8 additions and 5 deletions
|
@ -625,11 +625,14 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
|
||||||
|
|
||||||
private List<RoutingParameter> getReliefParameters() {
|
private List<RoutingParameter> getReliefParameters() {
|
||||||
List<RoutingParameter> reliefFactorParameters = new ArrayList<>();
|
List<RoutingParameter> reliefFactorParameters = new ArrayList<>();
|
||||||
Map<String, RoutingParameter> parameters = app.getRouter(applicationMode).getParameters();
|
GeneralRouter router = app.getRouter(applicationMode);
|
||||||
for (Map.Entry<String, RoutingParameter> entry : parameters.entrySet()) {
|
if (router != null) {
|
||||||
RoutingParameter routingParameter = entry.getValue();
|
Map<String, RoutingParameter> parameters = router.getParameters();
|
||||||
if (RELIEF_SMOOTHNESS_FACTOR.equals(routingParameter.getGroup())) {
|
for (Map.Entry<String, RoutingParameter> entry : parameters.entrySet()) {
|
||||||
reliefFactorParameters.add(routingParameter);
|
RoutingParameter routingParameter = entry.getValue();
|
||||||
|
if (RELIEF_SMOOTHNESS_FACTOR.equals(routingParameter.getGroup())) {
|
||||||
|
reliefFactorParameters.add(routingParameter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return reliefFactorParameters;
|
return reliefFactorParameters;
|
||||||
|
|
Loading…
Reference in a new issue