You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2026/04/14 15:00:39 UTC

(ofbiz-framework) branch release24.09 updated: Fixed: Possible NPE in PayPal services (OFBIZ-13385)

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

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


The following commit(s) were added to refs/heads/release24.09 by this push:
     new c24ec27aff Fixed: Possible NPE in PayPal services (OFBIZ-13385)
c24ec27aff is described below

commit c24ec27affc98360ab54c190a0a7536e2a5d5a02
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Tue Apr 14 16:55:50 2026 +0200

    Fixed: Possible NPE in PayPal services (OFBIZ-13385)
    
    As I said on dev ML: That looked so easy and I did not saw all points.
    That fixes them
    
    Thanks: Vitaly Repetenko and Jacopo for spotting issues
---
 .../org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
index 32f9f0386c..9727cabd36 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
@@ -94,9 +94,9 @@ public class PayPalServices {
 
     public static Map<String, Object> setExpressCheckout(DispatchContext dctx, Map<String, ? extends Object> context) {
         ShoppingCart cart = (ShoppingCart) context.get("cart");
-        Locale locale = cart.getLocale();
         if (cart != null ) {
-            if (cart.items().size() <= 0) {
+            Locale locale = cart.getLocale();
+            if (cart.items().isEmpty() {
                 return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE,
                         "AccountingPayPalShoppingCartIsEmpty", locale));
             }