svn commit: r1139887 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1139887 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java

doogie-3
Author: doogie
Date: Sun Jun 26 18:11:24 2011
New Revision: 1139887

URL: http://svn.apache.org/viewvc?rev=1139887&view=rev
Log:
FIX: Protect against a null return from getRelations().

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java?rev=1139887&r1=1139886&r2=1139887&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java Sun Jun 26 18:11:24 2011
@@ -93,8 +93,10 @@ public class EntityPlanner extends Plann
                 dve.addAliasAll(fieldAll.getAlias(), null, excludes);
             }
         }
-        for (Relation relation: selectStatement.getRelations().values()) {
-            dve.addRelation(relation.getType(), relation.getTitle(), relation.getEntityName(), buildKeyMaps(relation));
+        if (selectStatement.getRelations() != null) {
+            for (Relation relation: selectStatement.getRelations().values()) {
+                dve.addRelation(relation.getType(), relation.getTitle(), relation.getEntityName(), buildKeyMaps(relation));
+            }
         }
         List<String> groupBy = selectGroup.getGroupBy();
         if (groupBy == null) {