src/main/java/de/avatic/lcc/service/api/BatchGeoApiService.java aktualisiert

Fixed nullpointer exception in batch geo coding
This commit is contained in:
Jan Weber 2026-01-22 09:35:12 +00:00
parent 462a960c68
commit 03cd1274e9

View file

@ -73,7 +73,8 @@ public class BatchGeoApiService {
if (!result.getFeatures().isEmpty() && if (!result.getFeatures().isEmpty() &&
(result.getFeatures().getFirst().getProperties().getConfidence().equalsIgnoreCase("high") || (result.getFeatures().getFirst().getProperties().getConfidence().equalsIgnoreCase("high") ||
result.getFeatures().getFirst().getProperties().getConfidence().equalsIgnoreCase("medium") || result.getFeatures().getFirst().getProperties().getConfidence().equalsIgnoreCase("medium") ||
result.getFeatures().getFirst().getProperties().getMatchCodes().stream().anyMatch(s -> s.equalsIgnoreCase("good")))) { (result.getFeatures().getFirst().getProperties().getMatchCodes() != null &&
result.getFeatures().getFirst().getProperties().getMatchCodes().stream().anyMatch(s -> s.equalsIgnoreCase("good"))))) {
var geometry = result.getFeatures().getFirst().getGeometry(); var geometry = result.getFeatures().getFirst().getGeometry();
var properties = result.getFeatures().getFirst().getProperties(); var properties = result.getFeatures().getFirst().getProperties();
node.setGeoLng(BigDecimal.valueOf(geometry.getCoordinates().get(0))); node.setGeoLng(BigDecimal.valueOf(geometry.getCoordinates().get(0)));