Check for invalid VCF records (not enough tokens) instead of assuming they are there.
This commit is contained in:
parent
bed0acaed4
commit
f62af0291b
|
|
@ -155,7 +155,10 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec,
|
||||||
*/
|
*/
|
||||||
public Feature decodeLoc(String line) {
|
public Feature decodeLoc(String line) {
|
||||||
String[] locParts = new String[6];
|
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)
|
// get our alleles (because the end position depends on them)
|
||||||
String ref = getCachedString(locParts[3].toUpperCase());
|
String ref = getCachedString(locParts[3].toUpperCase());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue