Skip to content

Commit

Permalink
fix npe
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sikina committed Dec 22, 2023
1 parent ab8726b commit b484851
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public String runVcfExcerptQuery(Query query, boolean includePatientData) throws

Map<String, String[]> metadata = (metadataIndex == null ? null : metadataIndex.findByMultipleVariantSpec(variantList));

log.debug("metadata size " + metadata.size());
if(metadata == null || metadata.isEmpty()) {
return "No Variants Found\n"; //UI uses newlines to show result count
}

// Sort the variantSpecs so that the user doesn't lose their mind
TreeMap<String, String[]> metadataSorted = new TreeMap<>((o1, o2) -> {
Expand All @@ -153,11 +155,7 @@ public String runVcfExcerptQuery(Query query, boolean includePatientData) throws
metadataSorted.putAll(metadata);
metadata = metadataSorted;

if(metadata == null || metadata.isEmpty()) {
return "No Variants Found\n"; //UI uses newlines to show result count
} else {
log.debug("Found " + metadata.size() + " varaints");
}
log.debug("Found " + metadata.size() + " variants");

PhenoCube<String> idCube = null;
if(!ID_CUBE_NAME.contentEquals("NONE")) {
Expand Down

0 comments on commit b484851

Please sign in to comment.