svn commit: r1030597 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java

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

svn commit: r1030597 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java

jleroux@apache.org
Author: jleroux
Date: Wed Nov  3 18:30:33 2010
New Revision: 1030597

URL: http://svn.apache.org/viewvc?rev=1030597&view=rev
Log:
A patch from Sascha Rodekamp "NPE in Control Event listener when visits are disabled" (https://issues.apache.org/jira/browse/OFBIZ-3998) - OFBIZ-3998

When the visits are disabled the ControlEventListener throws a NPE.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java?rev=1030597&r1=1030596&r2=1030597&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ControlEventListener.java Wed Nov  3 18:30:33 2010
@@ -133,18 +133,20 @@ public class ControlEventListener implem
             Debug.log("Total Passive  : " + ControlEventListener.getTotalPassiveSessions(),  module);
             Debug.log("** note : this session has been counted as destroyed.", module);
             Debug.log("--------------------------------------------------------------------", module);
-            Debug.log("Visit ID       : " + visit.getString("visitId"), module);
-            Debug.log("Party ID       : " + visit.getString("partyId"), module);
-            Debug.log("Client IP      : " + visit.getString("clientIpAddress"), module);
-            Debug.log("Client Host    : " + visit.getString("clientHostName"), module);
-            Debug.log("Client User    : " + visit.getString("clientUser"), module);
-            Debug.log("WebApp         : " + visit.getString("webappName"), module);
-            Debug.log("Locale         : " + visit.getString("initialLocale"), module);
-            Debug.log("UserAgent      : " + visit.getString("initialUserAgent"), module);
-            Debug.log("Referrer       : " + visit.getString("initialReferrer"), module);
-            Debug.log("Initial Req    : " + visit.getString("initialRequest"), module);
-            Debug.log("Visit From     : " + visit.getString("fromDate"), module);
-            Debug.log("Visit Thru     : " + visit.getString("thruDate"), module);
+            if (visit != null) {
+                Debug.log("Visit ID       : " + visit.getString("visitId"), module);
+                Debug.log("Party ID       : " + visit.getString("partyId"), module);
+                Debug.log("Client IP      : " + visit.getString("clientIpAddress"), module);
+                Debug.log("Client Host    : " + visit.getString("clientHostName"), module);
+                Debug.log("Client User    : " + visit.getString("clientUser"), module);
+                Debug.log("WebApp         : " + visit.getString("webappName"), module);
+                Debug.log("Locale         : " + visit.getString("initialLocale"), module);
+                Debug.log("UserAgent      : " + visit.getString("initialUserAgent"), module);
+                Debug.log("Referrer       : " + visit.getString("initialReferrer"), module);
+                Debug.log("Initial Req    : " + visit.getString("initialRequest"), module);
+                Debug.log("Visit From     : " + visit.getString("fromDate"), module);
+                Debug.log("Visit Thru     : " + visit.getString("thruDate"), module);
+            }
             Debug.log("--------------------------------------------------------------------", module);
             Debug.log("--- Start Session Attributes: ---", module);
             Enumeration<String> sesNames = null;