svn commit: r797161 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r797161 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java

mor-2
Author: mor
Date: Thu Jul 23 17:39:42 2009
New Revision: 797161

URL: http://svn.apache.org/viewvc?rev=797161&view=rev
Log:
Fixed NumberFormatException

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java?rev=797161&r1=797160&r2=797161&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java Thu Jul 23 17:39:42 2009
@@ -29,6 +29,7 @@
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericValue;
 import org.ofbiz.service.DispatchContext;
@@ -74,12 +75,15 @@
             for (String rowKey : selectedMap.keySet()) {
                 String orderItemSeqId = itemMap.get(rowKey);
                 String productId = productMap.get(rowKey);
-                BigDecimal quantity = new BigDecimal(quantityMap.get(rowKey));
-                if (quantity.compareTo(ZERO) > 0) {
-                    try {
-                        pickSession.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, locale);
-                    } catch (Exception ex) {
-                        return ServiceUtil.returnError(ex.getMessage());
+                String quantityStr = quantityMap.get(rowKey);
+                if (UtilValidate.isNotEmpty(quantityStr)) {
+                    BigDecimal quantity = new BigDecimal(quantityStr);
+                    if (quantity.compareTo(ZERO) > 0) {
+                        try {
+                            pickSession.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, locale);
+                        } catch (Exception ex) {
+                            return ServiceUtil.returnError(ex.getMessage());
+                        }
                     }
                 }
             }