From ec5a20113d0be5cfa5b20253c68bd828e549e6c5 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 29 Aug 2023 22:23:08 +0200 Subject: [PATCH] Fixes thrown error when skull skin cache doesnt exist (#4082) --- .../org/geysermc/geyser/pack/SkullResourcePackManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/pack/SkullResourcePackManager.java b/core/src/main/java/org/geysermc/geyser/pack/SkullResourcePackManager.java index d9f7a6327f4..f59ae8026f7 100644 --- a/core/src/main/java/org/geysermc/geyser/pack/SkullResourcePackManager.java +++ b/core/src/main/java/org/geysermc/geyser/pack/SkullResourcePackManager.java @@ -139,6 +139,11 @@ public static void cacheSkullSkin(String skinHash) throws IOException { } public static void cleanSkullSkinCache() { + // No need to clean up if skin cache does not exist + if (!Files.exists(SKULL_SKIN_CACHE_PATH)) { + return; + } + try (Stream stream = Files.list(SKULL_SKIN_CACHE_PATH)) { int removeCount = 0; for (Path path : stream.toList()) {