details:   https://code.openbravo.com/erp/devel/pi/rev/446b08330250
changeset: 34515:446b08330250
user:      Mark <markmm82 <at> gmail.com>
date:      Tue Jul 31 10:05:27 2018 -0500
summary:   Fixed issue 39073:Fix NullPointerException in 
SL_RequisitionLine_Product callout
if product is not selected in Requisition line.

If the product wasn't selected then a NPE was thrown because was trying to get 
the
default AUM for an empty Product ID.

It is included a new condition validating that a product is selected and it is
not empty to avoid try to get a default AUM for an empty product and throw a 
NPE.

diffstat:

 src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java |  5 
+++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 41702504daa5 -r 446b08330250 
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java   
Tue Aug 07 19:54:15 2018 -0400
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product.java   
Tue Jul 31 10:05:27 2018 -0500
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -122,7 +122,8 @@
     }
 
     // Set AUM based on default
-    if (UOMUtil.isUomManagementEnabled() && 
StringUtils.isEmpty(strUOMProductId)) {
+    if (UOMUtil.isUomManagementEnabled() && 
StringUtils.isEmpty(strUOMProductId)
+        && StringUtils.isNotEmpty(strMProductID)) {
       String finalAUM = UOMUtil.getDefaultAUMForPurchase(strMProductID);
       if (finalAUM != null) {
         info.addResult("inpcAum", finalAUM);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to