work around bug in old versions of xalan bundled in JDK 1.4.2


git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@589544 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index 241655e..a2b24b7 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -1089,7 +1089,7 @@
                 XObject obj = XPathAPI.eval( doc, "//configuration/" + optionName );
 
                 NodeList nodeList = obj.nodelist();
-                if ( isList( nodeList.item( 0 ) ) )
+                if ( nodeList.getLength() > 0 && isList( nodeList.item( 0 ) ) )
                 {
                     /*
                      * <optionNames>
@@ -1182,7 +1182,6 @@
             }
             catch ( Exception e )
             {
-                e.printStackTrace();
                 throw new IOException( "Exception occured: " + e.getMessage() );
             }
         }