This is an automated email from the ASF dual-hosted git repository.

deepak pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
     new f10b42fa37 Replaced direct null checks on username, password, and 
token with UtilValidate.isEmpty() method calls for consistency.
f10b42fa37 is described below

commit f10b42fa37136c7bdd30745bda13ad9dde6952e0
Author: Deepak Dixit <dee...@apache.org>
AuthorDate: Thu Dec 14 18:20:33 2023 +0530

    Replaced direct null checks on username, password, and token with 
UtilValidate.isEmpty() method calls for consistency.
---
 .../src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
 
b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
index 2718a394a1..e8c1e61e6a 100644
--- 
a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
+++ 
b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
@@ -335,9 +335,9 @@ public class LoginWorker {
             password = request.getParameter("PASSWORD");
             token = request.getParameter("TOKEN");
             // check session attributes
-            if (username == null) username = (String) 
session.getAttribute("USERNAME");
-            if (password == null) password = (String) 
session.getAttribute("PASSWORD");
-            if (token == null) token = (String) session.getAttribute("TOKEN");
+            if (UtilValidate.isEmpty(username)) username = (String) 
session.getAttribute("USERNAME");
+            if (UtilValidate.isEmpty(password)) password = (String) 
session.getAttribute("PASSWORD");
+            if (UtilValidate.isEmpty(token)) token = (String) 
session.getAttribute("TOKEN");
 
             // in this condition log them in if not already; if not logged in 
or can't log in, save parameters and return error
             if (UtilValidate.isEmpty(username)

Reply via email to