diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java b/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java index e87986a2e..903133ffa 100755 --- a/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/features/annotator/AnnotatorInputTableCodec.java @@ -92,10 +92,13 @@ public class AnnotatorInputTableCodec implements ReferenceDependentFeatureCodec< GenomeLoc loc; String chr = st.nextToken(); - if ( chr.indexOf(":") != -1 ) + if ( chr.indexOf(":") != -1 ) { loc = genomeLocParser.parseGenomeInterval(chr); - else + } else { + if ( st.countTokens() < 3 ) + throw new CodecLineParsingException("Couldn't parse GenomeLoc out of the following line because there aren't enough tokens.\nLine: " + line); loc = genomeLocParser.createGenomeLoc(chr, Integer.valueOf(st.nextToken()), Integer.valueOf(st.nextToken())); + } return new AnnotatorInputTableFeature(loc.getContig(), (int)loc.getStart(), (int)loc.getStop()); }