From 0f69c95dd746440fb46e227cd721a27693aea22e Mon Sep 17 00:00:00 2001 From: ev chang Date: Sat, 22 Jun 2024 08:06:42 +0700 Subject: [PATCH] Add extra failsafes to ConfigColorElement --- .../oneconfig/gui/elements/config/ConfigColorElement.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java index a8a361981..9dc88c65d 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigColorElement.java @@ -95,7 +95,9 @@ else if (open) { protected void setColor(OneColor color) { try { + if (field == null) return; Object colorField = field.get(parent); + if (colorField == null || !(colorField instanceof OneColor)) return; if (!color.equals(colorField)) { ((OneColor) colorField).setFromOneColor(color); this.triggerListeners();