From 2a9c75c5bab980027636a02eb0d18e8624fdb867 Mon Sep 17 00:00:00 2001 From: kiran Date: Fri, 27 May 2011 22:08:48 +0000 Subject: [PATCH] Throw an exception if the programmer tries to access a column that doesn't exist. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5902 348d0f76-0448-11de-a6fe-93d51630548a --- .../org/broadinstitute/sting/gatk/report/GATKReportTable.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java b/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java index cbb794df0..0e503f92a 100755 --- a/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java +++ b/java/src/org/broadinstitute/sting/gatk/report/GATKReportTable.java @@ -195,6 +195,10 @@ public class GATKReportTable { * @param columnName the name of the column */ private void verifyEntry(Object primaryKey, String columnName) { + if (!columns.containsKey(columnName)) { + throw new ReviewedStingException("Attempted to access column '" + columnName + "' that does not exist in table '" + tableName + "'."); + } + primaryKeyColumn.add(primaryKey); if (!columns.get(columnName).containsKey(primaryKey)) {