details:   https://code.openbravo.com/erp/devel/pi/rev/7675b96ec421
changeset: 35752:7675b96ec421
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Fri May 10 09:04:47 2019 +0200
summary:   related to issue 40813: code review improvements

  - Check if request is null in isStatelessRequest() method itself

diffstat:

 src/org/openbravo/authentication/AuthenticationManager.java |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r eac83131aa3f -r 7675b96ec421 
src/org/openbravo/authentication/AuthenticationManager.java
--- a/src/org/openbravo/authentication/AuthenticationManager.java       Mon May 
06 14:08:39 2019 +0530
+++ b/src/org/openbravo/authentication/AuthenticationManager.java       Fri May 
10 09:04:47 2019 +0200
@@ -88,8 +88,8 @@
    * @return true if this is a stateless request
    */
   public static boolean isStatelessRequest(HttpServletRequest request) {
-    return "true".equals(request.getParameter(STATELESS_REQUEST_PARAMETER))
-        || "true".equals(request.getAttribute(STATELESS_REQUEST_PARAMETER));
+    return request != null && 
("true".equals(request.getParameter(STATELESS_REQUEST_PARAMETER))
+        || "true".equals(request.getAttribute(STATELESS_REQUEST_PARAMETER)));
   }
 
   /**
@@ -263,7 +263,7 @@
     // If the current license has unlimited number of WS calls no limit will 
be checked, so there is
     // no need to create a new register in the AD_Session table
     if (activationKey.hasUnlimitedWsAccess()) {
-      if (request != null && 
!AuthenticationManager.isStatelessRequest(request)) {
+      if (!AuthenticationManager.isStatelessRequest(request)) {
         // force creation of the http session in stateful WS requests
         request.getSession(true);
       }


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to