Skip to content

Commit

Permalink
Missing null check
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Aug 26, 2024
1 parent ee5f513 commit d2658c9
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 d2658c9

Please sign in to comment.