listFiles() can return null if the File its called on is not a directory,
or if any unspecified error or hiccup occurs within the acidic innards of the JVM. If that's the case, we probably will fail deleting the directory itself below these lines, but it's better than throwing a NPE and sticking a fork in everything. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1736 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -49,8 +49,10 @@ public class FileUtil
|
||||
{
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (int ii = 0; ii < files.length; ii++) {
|
||||
recursiveWipe(files[ii], true);
|
||||
if (files != null) {
|
||||
for (int ii = 0; ii < files.length; ii++) {
|
||||
recursiveWipe(files[ii], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wipeMe) {
|
||||
|
||||
Reference in New Issue
Block a user