Print

Print


Author: [log in to unmask]
Date: Tue Mar 10 16:02:32 2015
New Revision: 2393

Log:
Throw an exception if table name does not map to a known object type.

Modified:
    java/trunk/conditions/src/main/java/org/hps/conditions/database/ConditionsObjectConverter.java

Modified: java/trunk/conditions/src/main/java/org/hps/conditions/database/ConditionsObjectConverter.java
 =============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/database/ConditionsObjectConverter.java	(original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/database/ConditionsObjectConverter.java	Tue Mar 10 16:02:32 2015
@@ -76,6 +76,11 @@
         
         // Get the TableMetaData from the table name.
         TableMetaData tableMetaData = databaseConditionsManager.findTableMetaData(name);    
+        
+        // Throw an exception if the table name does not map to a known type.
+        if (tableMetaData == null) {
+            throw new RuntimeException(new ConditionsObjectException("No table information found for name: " + name));
+        }
         
         // Get the ConditionsRecordCollection with the run number assignments.
         ConditionsRecordCollection conditionsRecords = databaseConditionsManager.findConditionsRecords(name);