mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX][EXPERIMENTAL] Некорректная работа findRecursive при отсутствии конечного HashedEntry
This commit is contained in:
parent
b2a3e5672a
commit
2271b91653
2 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package pro.gravit.launcher.profiles.optional.actions;
|
||||
|
||||
import pro.gravit.launcher.hasher.HashedDir;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -13,7 +14,9 @@ public void injectToHashedDir(HashedDir dir)
|
|||
files.forEach((k,v) -> {
|
||||
HashedDir.FindRecursiveResult firstPath = dir.findRecursive(k);
|
||||
if (v != null && !v.isEmpty()) {
|
||||
LogHelper.dev("Debug findRecursive: name %s, parent: ", firstPath.name, firstPath.parent == null ? "null" : "not null", firstPath.entry == null ? "null" : "not null");
|
||||
HashedDir.FindRecursiveResult secondPath = dir.findRecursive(v);
|
||||
LogHelper.dev("Debug findRecursive: name %s, parent: ", secondPath.name, secondPath.parent == null ? "null" : "not null", secondPath.entry == null ? "null" : "not null");
|
||||
firstPath.parent.moveTo(firstPath.name, secondPath.parent, secondPath.name);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -126,6 +126,10 @@ public FindRecursiveResult findRecursive(String path)
|
|||
while (t.hasMoreTokens()) {
|
||||
name = t.nextToken();
|
||||
HashedEntry e = current.map.get(name);
|
||||
if(e == null && !t.hasMoreTokens())
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (e.getType() == Type.DIR) {
|
||||
if(!t.hasMoreTokens()) {
|
||||
entry = e;
|
||||
|
|
Loading…
Reference in a new issue