From 31d7d58eb079d7eedbc7329602c9d3c902bbdc17 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Fri, 17 Apr 2020 15:52:33 -0400 Subject: [PATCH] Use default sheep color if null, part 3. Fixes #1217 --- main/src/main/java/me/blackvein/quests/util/MiscUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/me/blackvein/quests/util/MiscUtil.java b/main/src/main/java/me/blackvein/quests/util/MiscUtil.java index 83dbe39d1..cae9524b6 100644 --- a/main/src/main/java/me/blackvein/quests/util/MiscUtil.java +++ b/main/src/main/java/me/blackvein/quests/util/MiscUtil.java @@ -167,9 +167,12 @@ public class MiscUtil { * Gets player-friendly name from type. 'LIGHT_BLUE' becomes 'Light Blue' * * @param type any dye type, ideally - * @return cleaned-up string + * @return cleaned-up string, or 'White' if null */ public static String getPrettyDyeColorName(DyeColor color) { + if (color == null) { + return "White"; + } if (!Lang.get("COLOR_" + color.name()).equals("NULL")) { // Legacy return Lang.get("COLOR_" + color.name());