From eac8896f3ec151e2bc6d51f9cf1b18fd84263ce4 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 18 Dec 2021 11:40:58 +0800 Subject: [PATCH] fix NPE in MultiplayerManager --- .../org/jackhuang/hmcl/ui/multiplayer/MultiplayerManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerManager.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerManager.java index deced0ddc..a4e091dcc 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerManager.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/multiplayer/MultiplayerManager.java @@ -400,7 +400,8 @@ public final class MultiplayerManager { onExit.fireEvent(new CatoExitEvent(this, CatoExitEvent.EXIT_CODE_INTERRUPTED)); } finally { try { - writer.close(); + if (writer != null) + writer.close(); } catch (IOException e) { LOG.log(Level.WARNING, "Failed to close cato stdin writer", e); }