From 8150cf2e2dd385cc193b68276e26374c85478a25 Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Tue, 6 Sep 2016 07:18:01 +0000 Subject: [PATCH] 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 --- .../main/java/org/apache/ofbiz/entity/GenericDelegator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java index 36d280808f..5c1f30c1c6 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java @@ -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)) {