diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java index 5091cc33f..4a814b1a0 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java @@ -767,7 +767,7 @@ public class IndelRealigner extends ReadWalker { // create a Consensus from just the indel string that falls on the reference private Consensus createAlternateConsensus(final int indexOnRef, final byte[] reference, final byte[] indelStr, final boolean isDeletion) { - if ( indexOnRef < 0 ) + if ( indexOnRef < 0 || indexOnRef >= reference.length ) return null; // create the new consensus