Commits

James Dumay committed 88cb78c

BAM-8352 check for null environment to avoid NPE when starting process.

  • Participants
  • Parent commits 016279a

Comments (0)

Files changed (1)

File src/main/java/com/atlassian/utils/process/ExternalProcess.java

 
         ProcessBuilder pb = new ProcessBuilder(cmdArray);
         pb.directory(workingDir);
-        pb.environment().putAll(environment);
+        if (environment != null)
+        {
+            pb.environment().putAll(environment);
+        }
         return pb.start();
     }
 
                     .command(cmdArray)
                     .directory(workingDir);
 
-            processBuilder.environment().putAll(environment);
+            if (environment != null)
+            {
+                processBuilder.environment().putAll(environment);
+            }
 
     		return processBuilder.start();
     	}