svn commit: r1139885 - /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: r1139885 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntityPlanner.java

doogie-3
Author: doogie
Date: Sun Jun 26 18:11:12 2011
New Revision: 1139885

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

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=1139885&r1=1139884&r2=1139885&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:12 2011
@@ -81,15 +81,17 @@ public class EntityPlanner extends Plann
         Table table = selectGroup.getTable();
         addMember(dve, table.getTableName());
         addJoined(dve, table.getTableName().getAlias(), table.getJoined());
-        for (FieldAll fieldAll: selectGroup.getFieldAlls()) {
-            List<String> excludes = FastList.newInstance();
-            for (String exclude: fieldAll) {
-                excludes.add(exclude);
-            }
-            if (excludes.isEmpty()) {
-                excludes = null;
+        if (selectGroup.getFieldAlls() != null) {
+            for (FieldAll fieldAll: selectGroup.getFieldAlls()) {
+                List<String> excludes = FastList.newInstance();
+                for (String exclude: fieldAll) {
+                    excludes.add(exclude);
+                }
+                if (excludes.isEmpty()) {
+                    excludes = null;
+                }
+                dve.addAliasAll(fieldAll.getAlias(), null, excludes);
             }
-            dve.addAliasAll(fieldAll.getAlias(), null, excludes);
         }
         for (Relation relation: selectStatement.getRelations().values()) {
             dve.addRelation(relation.getType(), relation.getTitle(), relation.getEntityName(), buildKeyMaps(relation));