Protect against NPE when using non-GATK reports for inputs expecting valid GATK reports

This commit is contained in:
Eric Banks 2012-11-19 09:07:04 -05:00
parent 843384e435
commit 78ce822b6f
1 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,9 @@ public enum GATKReportVersion {
* @return The version as an enum.
*/
public static GATKReportVersion fromHeader(String header) {
if ( header == null )
throw new UserException.BadInput("The GATK report has no version specified in the header");
if (header.startsWith("##:GATKReport.v0.1 "))
return GATKReportVersion.V0_1;