Permalink
Browse files

Protect against NPEs in SelectVariants by checking for missing Genotypes

  • Loading branch information...
1 parent 9a0d3d8 commit 99996f29f8c58d08f6fa649507f698270e81fc69 @eitanbanks eitanbanks committed Nov 13, 2012
@@ -659,7 +659,10 @@ private boolean sampleHasVariant(Genotype g) {
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))

0 comments on commit 99996f2

Please sign in to comment.