Author: sichen
Date: Mon Mar 5 09:47:39 2007
New Revision: 514747
URL:
http://svn.apache.org/viewvc?view=rev&rev=514747Log:
NPE protection in PackingSession.setPackageWeight()
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?view=diff&rev=514747&r1=514746&r2=514747==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Mon Mar 5 09:47:39 2007
@@ -893,7 +893,11 @@
}
public void setPackageWeight(int packageSeqId, Double packageWeight) {
- packageWeights.put(new Integer(packageSeqId), packageWeight);
+ if (UtilValidate.isEmpty(packageWeight)) {
+ packageWeights.remove(new Integer(packageSeqId));
+ } else {
+ packageWeights.put(new Integer(packageSeqId), packageWeight);
+ }
}
public Double getPackageWeight(int packageSeqId) {