svn commit: r803133 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

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

svn commit: r803133 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

jacopoc
Author: jacopoc
Date: Tue Aug 11 14:06:37 2009
New Revision: 803133

URL: http://svn.apache.org/viewvc?rev=803133&view=rev
Log:
Fix for NPE when emailAddress is not entered exporting products to eBay; thanks to Marco Risaliti for the patch.

Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=803133&r1=803132&r2=803133&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Tue Aug 11 14:06:37 2009
@@ -319,6 +319,7 @@
 
     private static void setPaymentMethodAccepted(Document itemDocument, Element itemElem, Map context) {
         String payPal = (String)context.get("paymentPayPal");
+        String payPalEmail = (String)context.get("payPalEmail");
         String visaMC = (String)context.get("paymentVisaMC");
         String amEx = (String)context.get("paymentAmEx");
         String discover = (String)context.get("paymentDiscover");
@@ -334,7 +335,10 @@
         // PayPal
         if (UtilValidate.isNotEmpty(payPal) && "on".equals(payPal)) {
             UtilXml.addChildElementValue(itemElem, "PaymentMethods", "PayPal", itemDocument);
-            UtilXml.addChildElementValue(itemElem, "PayPalEmailAddress", (String)context.get("payPalEmail"), itemDocument);
+            // PayPal email
+            if (UtilValidate.isNotEmpty(payPalEmail)) {
+                UtilXml.addChildElementValue(itemElem, "PayPalEmailAddress", payPalEmail, itemDocument);
+            }
         }
         // Visa/Master Card
         if (UtilValidate.isNotEmpty(visaMC) && "on".equals(visaMC)) {