Skip to content

Commit

Permalink
Merge pull request #11472 from hzi-braunschweig/change-9054-missing-n…
Browse files Browse the repository at this point in the history
…ull-check

#9054 added missing null check
  • Loading branch information
MartinWahnschaffe authored Feb 9, 2023
2 parents e7a647c + 0386b83 commit 943c563
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions sormas-ui/src/main/java/de/symeda/sormas/ui/utils/AbstractView.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,20 @@ public static String buildNavigationState(String currentState, BaseCriteria... c
newState = newState.substring(0, paramsIndex);
}

String urlParams = Arrays.stream(criteriaList)
.filter(Objects::nonNull)
.map(BaseCriteria::toUrlParams)
.filter(params -> !DataHelper.isNullOrEmpty(params))
.collect(Collectors.joining("&"));

if (urlParams.length() > 0) {
if (newState.charAt(newState.length() - 1) != '/') {
newState += "/";
if (criteriaList != null)
{
String urlParams = Arrays.stream(criteriaList)
.filter(Objects::nonNull)
.map(BaseCriteria::toUrlParams)
.filter(params -> !DataHelper.isNullOrEmpty(params))
.collect(Collectors.joining("&"));

if (urlParams.length() > 0) {
if (newState.charAt(newState.length() - 1) != '/') {
newState += "/";
}
newState += "?" + urlParams;
}
newState += "?" + urlParams;
}

return newState;
Expand Down

0 comments on commit 943c563

Please sign in to comment.