svn commit: r1828233 - /ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/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: r1828233 - /ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java

mbrohl
Author: mbrohl
Date: Tue Apr  3 13:06:28 2018
New Revision: 1828233

URL: http://svn.apache.org/viewvc?rev=1828233&view=rev
Log:
Fixed: Prevent possible NullPointerException.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java?rev=1828233&r1=1828232&r2=1828233&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java Tue Apr  3 13:06:28 2018
@@ -210,8 +210,11 @@ public class FinAccountServices {
             Timestamp now = UtilDateTime.nowTimestamp();
 
             // now use our values
-            String finAccountCode = FinAccountHelper.getNewFinAccountCode(accountCodeLength.intValue(), delegator);
-            inContext.put("finAccountCode", finAccountCode);
+            String finAccountCode = null;
+            if (UtilValidate.isNotEmpty(accountCodeLength)) {
+                finAccountCode = FinAccountHelper.getNewFinAccountCode(accountCodeLength.intValue(), delegator);
+                inContext.put("finAccountCode", finAccountCode);
+            }
 
             // with pin codes, the account code becomes the ID and the pin becomes the code
             if ("Y".equalsIgnoreCase(requirePinCode)) {