diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9b3744 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# IntelliJ project files +.idea +*.iml +out +gen +target diff --git a/src/main/java/com/github/geko444/im4java/core/ImageCommand.java b/src/main/java/com/github/geko444/im4java/core/ImageCommand.java index 2da6532..469f6a5 100644 --- a/src/main/java/com/github/geko444/im4java/core/ImageCommand.java +++ b/src/main/java/com/github/geko444/im4java/core/ImageCommand.java @@ -249,12 +249,12 @@ public ProcessTask getProcessTask(Operation pOperation, Object... images) protected void finished(int pReturnCode) throws Exception { if (pReturnCode > 0) { CommandException ce; - if (iErrorText.size() > 0) { - ce = new CommandException(iErrorText.get(0)); + if (iErrorText != null && iErrorText.size() > 0) { + ce = new CommandException("return code: " + pReturnCode + " " + iErrorText.get(0)); + ce.setErrorText(iErrorText); } else { - ce = new CommandException("return code: " + pReturnCode); + ce = new CommandException("return code: " + pReturnCode); } - ce.setErrorText(iErrorText); ce.setReturnCode(pReturnCode); throw ce; } else {