IDEA-CR-13184 cleanup

This commit is contained in:
Vladimir.Orlov
2016-08-23 14:00:29 +03:00
parent fc8b03c7ab
commit c446c31339
@@ -45,7 +45,8 @@ public class DeleteAction extends PatchAction {
@Override
protected void doApply(ZipFile patchFile, File backupDir, File toFile) throws IOException {
//NOTE: a folder can be deleted only in case if it does not contain any user's files/folders.
if (!toFile.isDirectory() || (toFile.listFiles() != null && toFile.listFiles().length == 0)) {
File[] listFiles = toFile.listFiles();
if (!toFile.isDirectory() || (listFiles != null && listFiles.length == 0)) {
Utils.delete(toFile);
}
}