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 2012/11/07 18:36:07 UTC

svn commit: r1406727 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Author: jleroux
Date: Wed Nov  7 17:36:07 2012
New Revision: 1406727

URL: http://svn.apache.org/viewvc?rev=1406727&view=rev
Log:
A patch from Leon for "slight update to ShoppingCartEvents.loadCartFromQuote to avoid NPE exception" https://issues.apache.org/jira/browse/OFBIZ-5068

There's a quote within that one product has been released and no valid price set. If try to create order from this quote, NPE exception raised.

=> Check the result return from runSync("loadCartFromQuote")

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1406727&r1=1406726&r2=1406727&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Wed Nov  7 17:36:07 2012
@@ -1349,6 +1349,10 @@ public class ShoppingCartEvents {
                     UtilMisc.<String, Object>toMap("quoteId", quoteId,
                             "applyQuoteAdjustments", "true",
                             "userLogin", userLogin));
+            if (!ServiceUtil.isSuccess(outMap)) {
+                request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(outMap));
+                return "error";
+            }
             cart = (ShoppingCart) outMap.get("shoppingCart");
         } catch (GenericServiceException exc) {
             request.setAttribute("_ERROR_MESSAGE_", exc.getMessage());