Fixes issue 20709: NPE when adding a payment from invoice
authorJavier Etxarri <javier.echarri@openbravo.com>
Fri, 08 Jun 2012 10:55:44 +0200
changeset 16793 b37708f3bc77
parent 16792 58e057ead4fb
child 16794 61fb6c14f182
Fixes issue 20709: NPE when adding a payment from invoice
issue 20692: Error 'Out of range' in invoices with two or more orders related
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Fri Jun 08 09:59:53 2012 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Fri Jun 08 10:55:44 2012 +0200
@@ -580,7 +580,7 @@
       throws ServletException {
 
     String strSelectedRecords = "";
-    if (!"".equals(strSelectedPaymentDetails)) {
+    if (!"".equals(strSelectedPaymentDetails) && strSelectedPaymentDetails != null) {
       strSelectedRecords = strSelectedPaymentDetails;
       strSelectedRecords = strSelectedRecords.replace("(", "");
       strSelectedRecords = strSelectedRecords.replace(")", "");
@@ -605,7 +605,8 @@
             .contains(FIN_PaymentScheduleDetails[i])) ? FIN_PaymentScheduleDetails[i].getId() : "";
         // If selectedId belongs to a grouping selection calculate whether it should be selected or
         // not
-        if (!"".equals(selectedId) && !"".equals(strSelectedPaymentDetails)) {
+        if (!"".equals(selectedId) && !"".equals(strSelectedPaymentDetails)
+            && strSelectedPaymentDetails != null) {
           StringTokenizer records = new StringTokenizer(strSelectedRecords, "'");
           Set<String> recordSet = new LinkedHashSet<String>();
           while (records.hasMoreTokens()) {