svn commit: r967098 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java

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

svn commit: r967098 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java

jleroux@apache.org
Author: jleroux
Date: Fri Jul 23 13:59:16 2010
New Revision: 967098

URL: http://svn.apache.org/viewvc?rev=967098&view=rev
Log:
A patch from Sascha Rodekamp "NPE in Financial Account Services" (https://issues.apache.org/jira/browse/OFBIZ-3873) - OFBIZ-3873

NPE in the financial account services when creating a financial account for a store. The error occurred when the accountValidDays is empty. The thru date can not be set.
This patch covers this issue by checking if accountValidDays is empty or not.

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=967098&r1=967097&r2=967098&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Fri Jul 23 13:59:16 2010
@@ -208,7 +208,9 @@ public class FinAccountServices {
             }
 
             // set the dates/userlogin
-            inContext.put("thruDate", UtilDateTime.getDayEnd(now, accountValidDays));
+            if (UtilValidate.isNotEmpty(accountValidDays)){
+                inContext.put("thruDate", UtilDateTime.getDayEnd(now, accountValidDays));
+            }
             inContext.put("fromDate", now);
             inContext.put("userLogin", userLogin);