Skip to content

Commit

Permalink
Fix NPE in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Mar 22, 2024
1 parent 60b16ba commit da5a4b1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ public FileBackedJsonIndexStorage<Integer, ConcurrentHashMap<String, VariableVar
ConcurrentHashMap<String, VariableVariantMasks> maskMap = merged.get(key);
maskMap.keySet().stream().sorted().limit(5).forEach(variantSpec -> {
VariableVariantMasks variableVariantMasks = maskMap.get(variantSpec);
Set<Integer> patientsWithVariant = VariableVariantMasks.patientMaskToPatientIdSet(variableVariantMasks.heterozygousMask.union(variableVariantMasks.homozygousMask), Arrays.asList(mergedVariantStore.getPatientIds()));
VariantMask union = Optional.ofNullable(variableVariantMasks.heterozygousMask).orElse(VariantMask.emptyInstance()).union(Optional.ofNullable(variableVariantMasks.homozygousMask).orElse(VariantMask.emptyInstance()));
Set<Integer> patientsWithVariant = VariableVariantMasks.patientMaskToPatientIdSet(union, Arrays.asList(mergedVariantStore.getPatientIds()));
log.info("Patients with variant [" + variantSpec + "]: " + Joiner.on(",").join(patientsWithVariant));
});

Expand Down

0 comments on commit da5a4b1

Please sign in to comment.