Throw an exception rather than failing with a NPE if delegatorInfo is null: this can happen for example when the entityconfig.xml file is missing.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2016-09-06 07:18:01 +00:00
parent 4cbedfc518
commit 8150cf2e2d
@@ -194,6 +194,10 @@ public class GenericDelegator implements Delegator {
this.setDelegatorNames(delegatorFullName);
this.delegatorInfo = EntityConfig.getInstance().getDelegator(delegatorBaseName);
if (this.delegatorInfo == null) {
throw new GenericEntityException("No configuration found for delegator [" + delegatorFullName + "]");
}
String kekText;
// before continuing, if there is a tenantId use the base delegator to see if it is valid
if (UtilValidate.isNotEmpty(this.delegatorTenantId)) {