Skip to content

Commit c24ec27

Browse files
committed
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
1 parent 4ede6be commit c24ec27

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal

applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/paypal/PayPalServices.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ public class PayPalServices {
9494

9595
public static Map<String, Object> setExpressCheckout(DispatchContext dctx, Map<String, ? extends Object> context) {
9696
ShoppingCart cart = (ShoppingCart) context.get("cart");
97-
Locale locale = cart.getLocale();
9897
if (cart != null ) {
99-
if (cart.items().size() <= 0) {
98+
Locale locale = cart.getLocale();
99+
if (cart.items().isEmpty() {
100100
return ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE,
101101
"AccountingPayPalShoppingCartIsEmpty", locale));
102102
}

0 commit comments

Comments
 (0)