details:   https://code.openbravo.com/erp/devel/pi/rev/de3d99d64d0c
changeset: 17779:de3d99d64d0c
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Tue Aug 28 09:18:58 2012 +0200
summary:   Fixes issue 0021465: Prevents Null Pointer Exception.

diffstat:

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

diffs (15 lines):

diff -r a0958de2d54d -r de3d99d64d0c 
src/org/openbravo/costing/CostingAlgorithm.java
--- a/src/org/openbravo/costing/CostingAlgorithm.java   Tue Aug 28 08:43:46 
2012 +0200
+++ b/src/org/openbravo/costing/CostingAlgorithm.java   Tue Aug 28 09:18:58 
2012 +0200
@@ -491,8 +491,9 @@
       
calculateWorkEffortCost(transaction.getProductionLine().getProductionPlan().getProduction());
     }
     OBDal.getInstance().refresh(transaction.getProductionLine());
-    return transaction.getProductionLine().getEstimatedCost()
-        .multiply(transaction.getMovementQuantity().abs());
+    return transaction.getProductionLine().getEstimatedCost() != null ? 
transaction
+        
.getProductionLine().getEstimatedCost().multiply(transaction.getMovementQuantity().abs())
+        : BigDecimal.ZERO;
   }
 
   /**

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to