From f62af0291b6863d2cb48c7ca26c807e39111432e Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Mon, 31 Oct 2011 14:09:51 -0400 Subject: [PATCH] Check for invalid VCF records (not enough tokens) instead of assuming they are there. --- .../sting/utils/codecs/vcf/AbstractVCFCodec.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java index bb212e128..d835ef666 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java @@ -155,7 +155,10 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, */ public Feature decodeLoc(String line) { String[] locParts = new String[6]; - ParsingUtils.split(line, locParts, VCFConstants.FIELD_SEPARATOR_CHAR, true); + int nParts = ParsingUtils.split(line, locParts, VCFConstants.FIELD_SEPARATOR_CHAR, true); + + if ( nParts != 6 ) + throw new UserException.MalformedVCF("there aren't enough columns for line " + line, lineNo); // get our alleles (because the end position depends on them) String ref = getCachedString(locParts[3].toUpperCase());