Skip to content

Commit

Permalink
Merge pull request #82 from aodn/bugs/5277-null-on-sortvalues
Browse files Browse the repository at this point in the history
Missing null check
  • Loading branch information
vietnguyengit authored Aug 26, 2024
2 parents 0c68e69 + d2658c9 commit 0e91f07
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import au.org.aodn.ogcapi.features.model.Collection;
import au.org.aodn.ogcapi.features.model.Collections;
import au.org.aodn.ogcapi.features.model.Link;
import au.org.aodn.ogcapi.server.core.model.ExtendedCollections;
import au.org.aodn.ogcapi.server.core.model.StacCollectionModel;
import au.org.aodn.ogcapi.server.core.service.ElasticSearch;
import org.mapstruct.Mapper;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -28,7 +26,9 @@ public Collections convert(ElasticSearch.SearchResult model) {

ExtendedCollections result = new ExtendedCollections();
result.setTotal(model.getTotal());
result.setSearchAfter(model.getSortValues().stream().map(String::valueOf).toList());
if(model.getSortValues() != null) {
result.setSearchAfter(model.getSortValues().stream().map(String::valueOf).toList());
}
result.setCollections(collections);

return result;
Expand Down

0 comments on commit 0e91f07

Please sign in to comment.