Correctly guess affected folder depth

This commit is contained in:
Reinhard Pointner 2016-05-12 20:39:47 +08:00
parent d5bdb33799
commit 9e87393258
1 changed files with 2 additions and 2 deletions

View File

@ -160,13 +160,13 @@ class RenameAction extends AbstractAction {
File destinationFolder = resolve(s, d).getParentFile();
// destination folder is the source, or is inside the source folder
if (destinationFolder.getPath().startsWith(sourceFolder.getPath())) {
if (d.getParentFile() == null || destinationFolder.getPath().startsWith(sourceFolder.getPath())) {
return;
}
try {
// guess affected folder depth
int tailSize = listStructurePathTail(s).size();
int tailSize = listStructurePathTail(d.getParentFile()).size();
for (int i = 0; i < tailSize && !isStructureRoot(sourceFolder); sourceFolder = sourceFolder.getParentFile(), i++) {
File[] children = sourceFolder.listFiles();