From ab113d5c5b5cb00360c7e5993e2cad46b958ed50 Mon Sep 17 00:00:00 2001 From: Andres Becerra Date: Mon, 8 Jan 2024 17:09:03 +0000 Subject: [PATCH] SCRUM-3315: add checks for getEvidenceCodes returning null --- .../curation/DiseaseAnnotationCurationIndexer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/DiseaseAnnotationCurationIndexer.java b/agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/DiseaseAnnotationCurationIndexer.java index 3bea3c05a..6536da3b3 100644 --- a/agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/DiseaseAnnotationCurationIndexer.java +++ b/agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/DiseaseAnnotationCurationIndexer.java @@ -136,8 +136,12 @@ private List createGeneDiseaseAnnotationDocuments } Map evidenceCodesMap = new HashMap(); - gdad.getEvidenceCodes().forEach( ecoTerm -> evidenceCodesMap.put(ecoTerm.getCurie(), ecoTerm)); - da.getEvidenceCodes().forEach( ecoTerm -> evidenceCodesMap.put(ecoTerm.getCurie(), ecoTerm)); + if(gdad.getEvidenceCodes() != null) { + gdad.getEvidenceCodes().forEach(ecoTerm -> evidenceCodesMap.put(ecoTerm.getCurie(), ecoTerm)); + } + if(da.getEvidenceCodes() != null) { + da.getEvidenceCodes().forEach(ecoTerm -> evidenceCodesMap.put(ecoTerm.getCurie(), ecoTerm)); + } gdad.setEvidenceCodes(evidenceCodesMap.values().stream().toList()); if(CollectionUtils.isNotEmpty(da.getDiseaseQualifiers())) {