add file.exists() check

This commit is contained in:
Manfred Karrer 2016-04-11 21:42:51 +02:00
parent e5adad637d
commit 260f592f7b

View file

@ -73,7 +73,7 @@ public class FileUtil {
for (File c : files) for (File c : files)
deleteDirectory(c); deleteDirectory(c);
} }
if (!file.delete()) if (file.exists() && !file.delete())
throw new FileNotFoundException("Failed to delete file: " + file); throw new FileNotFoundException("Failed to delete file: " + file);
} }
} }