svn commit: r1090964 - /ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

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

svn commit: r1090964 - /ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

jleroux@apache.org
Author: jleroux
Date: Mon Apr 11 08:02:11 2011
New Revision: 1090964

URL: http://svn.apache.org/viewvc?rev=1090964&view=rev
Log:
Fixes a NPE in GenericDispatcher.java. It's related to tenants changes. It appears when you set a jms-service: you have no delegator when you try to create a GenericMessageListener in JmsListenerFactory, but was hidden there

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java?rev=1090964&r1=1090963&r2=1090964&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Mon Apr 11 08:02:11 2011
@@ -52,11 +52,13 @@ public class GenericDispatcher extends G
             dispatcherName = delegator.getDelegatorName();
             Debug.logWarning("Got a getGenericDispatcher call with a null dispatcherName, assuming default for the name.", module);
         }
-        
-        if (UtilValidate.isNotEmpty(delegator.getDelegatorTenantId())) {
-            dispatcherName += "#" + delegator.getDelegatorTenantId();
+
+        if (UtilValidate.isNotEmpty(delegator)) {
+            if (UtilValidate.isNotEmpty(delegator.getDelegatorTenantId())) {
+                dispatcherName += "#" + delegator.getDelegatorTenantId();
+            }
         }
-        
+
         LocalDispatcher dispatcher = dispatcherCache.get(dispatcherName);
 
         if (dispatcher == null) {