Fix for the case of requesting genotype for a sample that doesn't exist in a VariantContext

This commit is contained in:
Ryan Poplin 2011-07-12 13:55:21 -04:00
parent cfe43e3971
commit 73735863b0
1 changed files with 4 additions and 1 deletions

View File

@ -867,7 +867,10 @@ public class VariantContext implements Feature { // to enable tribble intergrati
for ( String name : sampleNames ) {
if ( map.containsKey(name) ) throw new IllegalArgumentException("Duplicate names detected in requested samples " + sampleNames);
map.put(name, getGenotype(name));
final Genotype g = getGenotype(name);
if ( g != null ) {
map.put(name, g);
}
}
return map;