Skip to content

Commit

Permalink
fix(oxtrust-server): display name sorting null issue #2348
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar16 committed Aug 22, 2023
1 parent e39e30d commit ce415cc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.Serializable;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

import javax.enterprise.context.ConversationScoped;
import javax.faces.application.FacesMessage;
Expand Down Expand Up @@ -76,7 +77,10 @@ protected String searchImpl() {
} else {
this.clientList = clientService.searchClients(this.searchPattern, 100);
}
this.clientList.sort(Comparator.comparing(OxAuthClient::getDisplayName));
this.clientList = this.clientList.stream()
.sorted(Comparator.comparing(OxAuthClient::getDisplayName,
Comparator.nullsFirst(Comparator.naturalOrder())))
.collect(Collectors.toList());
this.oldSearchPattern = this.searchPattern;
this.searchPattern = "";
} catch (Exception ex) {
Expand Down

0 comments on commit ce415cc

Please sign in to comment.