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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 69cff24  Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
69cff24 is described below

commit 69cff24c829ca8a45b41b66f39c37aa949e96f73
Author: Jacques Le Roux <[email protected]>
AuthorDate: Fri Dec 10 09:51:08 2021 +0100

    Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
    
    In WebToolsServices::entityImportDir fixes a possible null dereferencement
    
    Missed in previous commit, not sure why
---
 .../src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
 
b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
index aa12650..c21169a 100644
--- 
a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
+++ 
b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java
@@ -251,6 +251,10 @@ public class WebToolsServices {
             if (baseDir.isDirectory() && baseDir.canRead()) {
                 File[] fileArray = baseDir.listFiles();
                 List<File> files = new LinkedList<>();
+                if (fileArray == null) {
+                    Debug.logError("There are no files to import from this 
directory!", MODULE);
+                    return null;
+                }
                 for (File file : fileArray) {
                     if (file.getName().toUpperCase().endsWith("XML")) {
                         files.add(file);

Reply via email to