diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java index ea60802c3..ac7c313b8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java @@ -400,7 +400,14 @@ public class JspC extends MatchingTask { */ public void execute() throws BuildException { - if (destDir != null && !destDir.isDirectory()) { + + // make sure that we've got a destdir + if (destDir == null) { + throw new BuildException("destdir attribute must be set!", + getLocation()); + } + + if (!destDir.isDirectory()) { throw new BuildException("destination directory \"" + destDir + "\" does not exist or is not a directory",