diff options
-rw-r--r-- | api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java | 9 | ||||
-rw-r--r-- | daemon/src/main/java/org/openslx/taskmanager/network/NetworkHandler.java | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java b/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java index 7b67c12..2f3cf57 100644 --- a/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java +++ b/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java @@ -5,6 +5,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import org.apache.log4j.Logger; @@ -37,6 +38,12 @@ public abstract class SystemCommandTask extends AbstractTask if ( command == null || command.length == 0 ) { return processEnded( -1 ); } + for (String a : command) { + if (a == null) { + log.warn( "An argument from initCommandLine is null: " + Arrays.toString( command ) ); + return processEnded( -5 ); + } + } ProcessBuilder pb = new ProcessBuilder( command ); pb.directory( new File( "/" ) ); @@ -47,7 +54,7 @@ public abstract class SystemCommandTask extends AbstractTask try { process = pb.start(); } catch ( Exception e ) { - log.warn( "Process of task " + getId() + " died." ); + log.warn( "Process of task " + getId() + " died.", e ); processStdErrInternal( e.toString() ); return processEnded( -2 ); } diff --git a/daemon/src/main/java/org/openslx/taskmanager/network/NetworkHandler.java b/daemon/src/main/java/org/openslx/taskmanager/network/NetworkHandler.java index 08a1d61..6946cd1 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/network/NetworkHandler.java +++ b/daemon/src/main/java/org/openslx/taskmanager/network/NetworkHandler.java @@ -144,7 +144,7 @@ public class NetworkHandler implements Runnable try { socket.send( packet ); } catch ( IOException e ) { - log.debug( "Could not send UDP packet to " + packet.getAddress().getHostAddress().toString() ); + log.debug( "Could not send UDP packet to " + packet.getAddress().getHostAddress().toString(), e ); } } } catch ( InterruptedException e ) { |