svn commit: r1633218 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java

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

svn commit: r1633218 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java

lektran
Author: lektran
Date: Mon Oct 20 20:10:27 2014
New Revision: 1633218

URL: http://svn.apache.org/r1633218
Log:
Fix NPE when filtering by date without having specified a where EntityCondition.  Thanks to Arun Patidar for the report.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java?rev=1633218&r1=1633217&r2=1633218&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java Mon Oct 20 20:10:27 2014
@@ -446,7 +446,11 @@ public class EntityQuery {
     private EntityCondition makeWhereCondition(boolean usingCache) {
         // we don't use the useCache field here because not all queries will actually use the cache, e.g. findCountByCondition never uses the cache
         if (filterByDate && !usingCache) {
+            if (whereEntityCondition != null) {
                 return EntityCondition.makeCondition(whereEntityCondition, this.makeDateCondition());
+            } else {
+                return this.makeDateCondition();
+            }
         }
         return whereEntityCondition;
     }