Protect against NPEs in SelectVariants by checking for missing Genotypes

This commit is contained in:
Eric Banks 2012-11-13 11:53:39 -05:00
parent c7335c9902
commit ba41f65759
1 changed files with 4 additions and 1 deletions

View File

@ -659,7 +659,10 @@ public class SelectVariants extends RodWalker<Integer, Integer> implements TreeR
return (g !=null && !g.isHomRef() && (g.isCalled() || (g.isFiltered() && !EXCLUDE_FILTERED)));
}
private boolean haveSameGenotypes(Genotype g1, Genotype g2) {
private boolean haveSameGenotypes(final Genotype g1, final Genotype g2) {
if ( g1 == null || g2 == null )
return false;
if ((g1.isCalled() && g2.isFiltered()) ||
(g2.isCalled() && g1.isFiltered()) ||
(g1.isFiltered() && g2.isFiltered() && EXCLUDE_FILTERED))