From b9d3fc3fbbac0f85df46408937cac6852cab5cd7 Mon Sep 17 00:00:00 2001 From: kiran Date: Tue, 30 Mar 2010 22:40:17 +0000 Subject: [PATCH] Now checks if the i-th element of the FiltrationContext[] is null before trying to access it. This seems to happen occassionally at the very end of a VCF file... the array will be 6 elements long, but the last element will actually be null. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3097 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/walkers/filters/ClusteredSnps.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java b/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java index b4935791f..7dfa6647a 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/filters/ClusteredSnps.java @@ -33,7 +33,7 @@ public class ClusteredSnps { int currentIndex = i; while ( ++currentIndex < variants.length ) { - if ( variants[currentIndex].getVariantContext().isVariant() ) { + if ( variants[currentIndex] != null && variants[currentIndex].getVariantContext() != null && variants[currentIndex].getVariantContext().isVariant() ) { if ( ++snpsSeen == snpThreshold ) { right = variants[currentIndex].getVariantContext().getLocation(); break;