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:41:15 UTC

svn commit: r1406731 - in /ofbiz/branches/release12.04: ./ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Author: jleroux
Date: Wed Nov  7 17:41:15 2012
New Revision: 1406731

URL: http://svn.apache.org/viewvc?rev=1406731&view=rev
Log:
"Applied fix from trunk for revision: 1406727" 
------------------------------------------------------------------------
r1406727 | jleroux | 2012-11-07 18:36:07 +0100 (mer., 07 nov. 2012) | 5 lines

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/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1406727

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1406731&r1=1406730&r2=1406731&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Wed Nov  7 17:41:15 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());