From 64974d63401b29ba107e8df33bd7e65d4cfdd195 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Fri, 9 Aug 2024 13:52:25 +0100 Subject: [PATCH] Only pull data from the map once --- .../org/geysermc/geyser/extension/GeyserExtensionLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java index bfa4bba8d..84fc82492 100644 --- a/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java +++ b/core/src/main/java/org/geysermc/geyser/extension/GeyserExtensionLoader.java @@ -213,7 +213,8 @@ public class GeyserExtensionLoader extends ExtensionLoader { GeyserExtensionDescription description = this.extensionDescription(path); // Remove the old extension with the same ID if it exists - if (extensionFiles.containsKey(description.id())) { + Path oldExtensionFile = extensionFiles.get(description.id()); + if (oldExtensionFile != null && Files.exists(oldExtensionFile)) { Files.delete(extensionFiles.get(description.id())); }