svn commit: r1763251 - /ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java

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

svn commit: r1763251 - /ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java

jacopoc
Author: jacopoc
Date: Tue Oct  4 09:04:42 2016
New Revision: 1763251

URL: http://svn.apache.org/viewvc?rev=1763251&view=rev
Log:
Fixed: Null Pointer Exception in the ecommerce webapp when accessed with
multitenant mode on, caused by the recent refactoring to ContextFilter.
(OFBIZ-8338)

Thanks: Ingo Wolfmayr for the bug report.

Modified:
    ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java

Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java?rev=1763251&r1=1763250&r2=1763251&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ContextFilter.java Tue Oct  4 09:04:42 2016
@@ -134,11 +134,11 @@ public class ContextFilter implements Fi
 
         WebAppUtil.setAttributesFromRequestBody(request);
 
-        if (!isMultitenant) {
-            request.setAttribute("delegator", config.getServletContext().getAttribute("delegator"));
-            request.setAttribute("dispatcher", config.getServletContext().getAttribute("dispatcher"));
-            request.setAttribute("security", config.getServletContext().getAttribute("security"));
-        } else {
+        request.setAttribute("delegator", config.getServletContext().getAttribute("delegator"));
+        request.setAttribute("dispatcher", config.getServletContext().getAttribute("dispatcher"));
+        request.setAttribute("security", config.getServletContext().getAttribute("security"));
+
+        if (isMultitenant) {
             // get tenant delegator by domain name
             String serverName = httpRequest.getServerName();
             try {