From dbe2a9b3b0df9c06d7fa194854ac8bb52e83ebb0 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Tue, 14 Apr 2020 23:35:59 -0500 Subject: [PATCH] Return COLOR_0 for null values in MapColor Might be better to eventually figure out why this is null to begin with, but for the time being considering maps are not working, we'd have to get to that step first. This just prevents the console from spamming errors, and will do until maps are fully implemented/fixed. --- .../src/main/java/org/geysermc/connector/utils/MapColor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/utils/MapColor.java b/connector/src/main/java/org/geysermc/connector/utils/MapColor.java index 2c4a13b9f..2db144648 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/MapColor.java +++ b/connector/src/main/java/org/geysermc/connector/utils/MapColor.java @@ -227,7 +227,7 @@ public enum MapColor { } public static MapColor fromId(int id) { - return Arrays.stream(values()).filter(color -> color.getId() == id).findFirst().get(); + return Arrays.stream(values()).filter(color -> color.getId() == id).findFirst().orElse(COLOR_0); } public int toARGB() {