db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r437448 - /db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java
Date Sun, 27 Aug 2006 20:00:05 GMT
Author: tv
Date: Sun Aug 27 13:00:04 2006
New Revision: 437448

URL: http://svn.apache.org/viewvc?rev=437448&view=rev
Log:
Fixed a NPE when no aliases were defined.

Modified:
    db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java?rev=437448&r1=437447&r2=437448&view=diff
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/util/BasePeer.java Sun Aug 27 13:00:04
2006
@@ -27,6 +27,7 @@
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
@@ -1570,10 +1571,10 @@
                 if (tableMap == null)
                 {
                     // try aliases
-                    if (criteria.getAliases().get(tableName) != null)
+                    Map aliases = criteria.getAliases();
+                    if (aliases != null && aliases.get(tableName) != null)
                     {
-                        tableName = (String) 
-                                criteria.getAliases().get(tableName);
+                        tableName = (String)aliases.get(tableName);
                         tableMap = databaseMap.getTable(tableName);
                     }
                 }
@@ -1583,6 +1584,7 @@
                     break;
                 }
             }
+            
             ColumnMap columnMap = tableMap.getColumn(columnName);
             if (columnMap != null)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message