Skip locations with no genotypes instead of throwing a NPE

This commit is contained in:
Joel Thibault 2012-04-10 16:55:01 -04:00
parent 4bdfeacdaa
commit 7ed0ee7ed0
1 changed files with 39 additions and 39 deletions

View File

@ -600,8 +600,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> implements TreeR
genotypes.add(Genotype.modifyAttributes(genotype, genotypeAttributes)); genotypes.add(Genotype.modifyAttributes(genotype, genotypeAttributes));
} }
// TODO: handle result == null if (result != null) {
ArrayList<Allele> alleles = new ArrayList<Allele>(); ArrayList<Allele> alleles = new ArrayList<Allele>();
BasicDBObject allelesInDb = (BasicDBObject)result.get("alleles"); BasicDBObject allelesInDb = (BasicDBObject)result.get("alleles");
for (Object alleleInDb : allelesInDb.values()) { for (Object alleleInDb : allelesInDb.values()) {
@ -641,6 +640,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> implements TreeR
builder.filters(filters); builder.filters(filters);
vcs.add(builder.make()); vcs.add(builder.make());
}
return vcs; return vcs;
} }