From 77b5188b52b85432012fb563c656e5ad1967d678 Mon Sep 17 00:00:00 2001 From: Gravita Date: Wed, 22 Sep 2021 11:02:23 +0700 Subject: [PATCH] [FIX] HashedDir NPE --- .../src/main/java/pro/gravit/launcher/hasher/HashedDir.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java b/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java index 748e39b4..22ab3401 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/hasher/HashedDir.java @@ -68,6 +68,7 @@ public void remove(String name) { map.remove(name); } + @Deprecated public void removeR(String name) { LinkedList dirs = new LinkedList<>(); StringTokenizer t = new StringTokenizer(name, "/"); @@ -117,6 +118,9 @@ public FindRecursiveResult findRecursive(String path) { if (e == null && !t.hasMoreTokens()) { break; } + if (e == null) { + throw new RuntimeException(String.format("Directory %s not found", name)); + } if (e.getType() == Type.DIR) { if (!t.hasMoreTokens()) { entry = e;