From cd396eee6b9fb1456c956f59702e12ae023e68d1 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sat, 21 Aug 2021 13:09:18 +0200 Subject: [PATCH] Fixes a NullPointerException caused by cancelling an input prompt --- .../minecraftserverlauncher/utility/CommonFunctions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/CommonFunctions.java b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/CommonFunctions.java index 7e20d7e..c20d2b1 100644 --- a/src/main/java/net/knarcraft/minecraftserverlauncher/utility/CommonFunctions.java +++ b/src/main/java/net/knarcraft/minecraftserverlauncher/utility/CommonFunctions.java @@ -331,7 +331,7 @@ public final class CommonFunctions { * @return

True if the name is valid

*/ public static boolean nameIsValid(String name) { - return !name.equals("") && name.matches("[^!?;,]+"); + return name != null && !name.equals("") && name.matches("[^!?;,]+"); } /**