bulletproofing for NPE's when deleting files
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java
index 6777b26..5af05b1 100644
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java
+++ b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java
@@ -102,19 +102,25 @@
   
   private void deleteFiles( File directory )
   {
-    File[] children = directory.listFiles();
-    
-    for( int index = 0; index < children.length; index++ )
-    {
-      File child = children[index];
-      
-      if( child.isDirectory() )
-      {
-        deleteFiles( child );
-      }
-      
-      child.delete();
-    }
+	if (directory != null) {
+			File[] children = directory.listFiles();
+
+			/*
+			 * If 'directory' is not a directory, directory.listFiles can
+			 * return null.
+			 */
+			if (children != null) {
+				for (int index = 0; index < children.length; index++) {
+					File child = children[index];
+
+					if (child.isDirectory()) {
+						deleteFiles(child);
+					}
+
+					child.delete();
+				}
+			}
+		}
   }
   
   private String getTmpFileURL( String fileName )