Author: jonesde
Date: Wed May 5 13:40:33 2010
New Revision: 941284
URL:
http://svn.apache.org/viewvc?rev=941284&view=revLog:
Check for bad entity name and return a better error message than an NPE
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=941284&r1=941283&r2=941284&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java Wed May 5 13:40:33 2010
@@ -79,6 +79,10 @@ public class PrimaryKeyFinder extends Fi
boolean autoFieldMapBool = !"false".equals(autoFieldMapString);
ModelEntity modelEntity = delegator.getModelEntity(entityName);
+ if (modelEntity == null) {
+ throw new IllegalArgumentException("No entity definition found for entity name [" + entityName + "]");
+ }
+
GenericValue valueOut = runFind(modelEntity, context, delegator, useCacheBool, autoFieldMapBool, this.fieldMap, this.selectFieldExpanderList);
//Debug.logInfo("PrimaryKeyFinder: valueOut=" + valueOut, module);