Author: hansbak
Date: Wed May 27 03:46:26 2009
New Revision: 778984
URL:
http://svn.apache.org/viewvc?rev=778984&view=revLog:
instead of a NPE show an error message
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java?rev=778984&r1=778983&r2=778984&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java Wed May 27 03:46:26 2009
@@ -219,6 +219,10 @@
value = StringUtil.split((String)value, delim);
}
}
+
+ if(modelEntity.getField(fieldName) == null) {
+ throw new IllegalArgumentException("Error in Entity Find: could not find field [" + fieldName + "] in entity with name [" + entityName + "]");
+ }
// don't convert the field to the desired type if this is an IN or BETWEEN operator and we have a Collection
if (!((operator == EntityOperator.IN || operator == EntityOperator.BETWEEN)