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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 5f1730bdf6 Fixed: createUpdateBillingAddressAndPaymentMethod throws 
NPE for anonymous checkout (OFBIZ-13584)
5f1730bdf6 is described below

commit 5f1730bdf686335f86cfe34e3fc72da860a69e78
Author: Mridul Pathak <[email protected]>
AuthorDate: Tue Sep 15 17:13:38 2026 +0530

    Fixed: createUpdateBillingAddressAndPaymentMethod throws NPE for anonymous 
checkout (OFBIZ-13584)
    
    The method dereferenced userLogin.userLoginId without checking userLogin 
for null first, throwing a NullPointerException whenever a partyId is present 
but the shopping cart has no associated userLogin (an anonymous checkout 
carrying a resolved party from elsewhere). The original minilang's dotted-field 
access degraded gracefully to null in that case instead of crashing. The guard 
now checks userLogin is non-null before accessing userLoginId, matching the 
pattern already used in the si [...]
---
 .../main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
index b4906b6d2e..b99877f2c3 100644
--- 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
+++ 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
@@ -136,7 +136,7 @@ Map createUpdateBillingAddressAndPaymentMethod() {
         shipToContactMechId = shipToContactMechId ?: 
shoppingCart.getShippingContactMechId()
     }
     if (partyId) {
-        if (userLogin.userLoginId == 'anonymous') {
+        if (userLogin && userLogin.userLoginId == 'anonymous') {
             userLogin.partyId = partyId
         }
     }

Reply via email to