[ofbiz-framework] branch release17.12 updated: Fixed: Prevent possible NullPointerException in FinAccountServices. (OFBIZ-11341)

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

[ofbiz-framework] branch release17.12 updated: Fixed: Prevent possible NullPointerException in FinAccountServices. (OFBIZ-11341)

mbrohl
This is an automated email from the ASF dual-hosted git repository.

mbrohl pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 69bdef1  Fixed: Prevent possible NullPointerException in FinAccountServices. (OFBIZ-11341)
69bdef1 is described below

commit 69bdef10585e931520cc6ec1b27aefec7cc2209b
Author: Michael Brohl <[hidden email]>
AuthorDate: Thu Feb 6 09:01:03 2020 +0100

    Fixed: Prevent possible NullPointerException in FinAccountServices.
    (OFBIZ-11341)
---
 .../org/apache/ofbiz/accounting/finaccount/FinAccountServices.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java
index 55a9311..f8980d5 100644
--- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java
+++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/finaccount/FinAccountServices.java
@@ -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)) {