From 306221a92f4a5287cebc1b7c0eb6b1cb362e44ae Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 30 Jul 2020 06:01:38 -0400 Subject: [PATCH] Use default shutdown reason if the disconnect message is blank. --- .../proxy/command/builtin/ShutdownCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/ShutdownCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/ShutdownCommand.java index ff445fd15..4440161fe 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/ShutdownCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/ShutdownCommand.java @@ -15,7 +15,11 @@ public class ShutdownCommand implements RawCommand { @Override public void execute(final Invocation invocation) { String reason = invocation.arguments(); - server.shutdown(true, LegacyComponentSerializer.legacy('&').deserialize(reason)); + if (reason.isEmpty() || reason.trim().isEmpty()) { + server.shutdown(true); + } else { + server.shutdown(true, LegacyComponentSerializer.legacy('&').deserialize(reason)); + } } @Override