ARTEMIS-1058 Fixing testsuite
authorClebert Suconic <clebertsuconic@apache.org>
Tue, 12 Feb 2019 08:42:28 +0000 (09:42 +0100)
committerClebert Suconic <clebertsuconic@apache.org>
Tue, 12 Feb 2019 08:42:31 +0000 (09:42 +0100)
Possible NPE that will happen on ReplicatedFailoverTest only

artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SpawnedVMSupport.java

index 6f47c82..82724c1 100644 (file)
@@ -141,13 +141,19 @@ public class SpawnedVMSupport {
 
       StringBuilder stringBuilder = new StringBuilder();
       boolean empty = true;
-      for (File f : libfolder.listFiles()) {
-         if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
-            if (!empty) {
-               stringBuilder.append(File.pathSeparator);
+      File[] files = libfolder.listFiles();
+
+      if (files == null) {
+         return getClassPath();
+      } else {
+         for (File f : libfolder.listFiles()) {
+            if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
+               if (!empty) {
+                  stringBuilder.append(File.pathSeparator);
+               }
+               empty = false;
+               stringBuilder.append(f.toString());
             }
-            empty = false;
-            stringBuilder.append(f.toString());
          }
       }