mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-30 16:13:55 +00:00
Making fix to null pointer exception (when fetching from /list).
This commit is contained in:
parent
cc5db6e3ed
commit
f244afffe0
@ -215,9 +215,10 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
|||||||
String orderColumnName = input.getOrderColumnName();
|
String orderColumnName = input.getOrderColumnName();
|
||||||
log.debug("Ordering on column: " + orderColumnName);
|
log.debug("Ordering on column: " + orderColumnName);
|
||||||
|
|
||||||
Order order = input.getOrder().get(0);
|
List<Order> orderList = input.getOrder();
|
||||||
|
Order order = null;
|
||||||
|
if (orderList.size() > 0)
|
||||||
|
order = input.getOrder().get(0);
|
||||||
|
|
||||||
int currentPage = input.getStart() / input.getLength();
|
int currentPage = input.getStart() / input.getLength();
|
||||||
Pageable paging = PageRequest.of(currentPage, input.getLength(), Sort.by(orderColumnName));
|
Pageable paging = PageRequest.of(currentPage, input.getLength(), Sort.by(orderColumnName));
|
||||||
@ -276,6 +277,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
|||||||
} else if (certificateType.equals(TRUSTCHAIN)) {
|
} else if (certificateType.equals(TRUSTCHAIN)) {
|
||||||
FilteredRecordsList<CertificateAuthorityCredential> records = new FilteredRecordsList<>();
|
FilteredRecordsList<CertificateAuthorityCredential> records = new FilteredRecordsList<>();
|
||||||
org.springframework.data.domain.Page<CertificateAuthorityCredential> pagedResult = this.caCredentialRepository.findByArchiveFlag(false, paging);;
|
org.springframework.data.domain.Page<CertificateAuthorityCredential> pagedResult = this.caCredentialRepository.findByArchiveFlag(false, paging);;
|
||||||
|
if (order != null) {
|
||||||
if (orderColumnName.equalsIgnoreCase("Issuer")) {
|
if (orderColumnName.equalsIgnoreCase("Issuer")) {
|
||||||
if (order.isAscending()) {
|
if (order.isAscending()) {
|
||||||
pagedResult = this.caCredentialRepository.findByArchiveFlagOrderByIssuerAsc(false, paging);
|
pagedResult = this.caCredentialRepository.findByArchiveFlagOrderByIssuerAsc(false, paging);
|
||||||
@ -289,6 +291,7 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
|||||||
pagedResult = this.caCredentialRepository.findByArchiveFlagOrderBySubjectDesc(false, paging);
|
pagedResult = this.caCredentialRepository.findByArchiveFlagOrderBySubjectDesc(false, paging);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pagedResult.hasContent()) {
|
if (pagedResult.hasContent()) {
|
||||||
records.addAll(pagedResult.getContent());
|
records.addAll(pagedResult.getContent());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user