From 9cbb009f815923218b2b9ab7d246d0e904f63710 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 8 May 2022 13:07:17 +0200 Subject: nasty nullpointers --- src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java | 2 +- src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java index b98c139..790d0e4 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModConfigPage.java @@ -39,7 +39,7 @@ public class ModConfigPage extends Page { @Override public void draw(long vg, int x, int y) { if (page.categories.size() == 0) return; - String filter = OneConfigGui.INSTANCE.getSearchValue().toLowerCase().trim(); + String filter = OneConfigGui.INSTANCE == null ? "" : OneConfigGui.INSTANCE.getSearchValue().toLowerCase().trim(); LinkedHashMap> filteredSubcategories = new LinkedHashMap<>(page.categories.get(selectedCategory).subcategories); if (!filter.equals("")) { filteredSubcategories.clear(); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java index 9b50d19..3cb00ec 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -41,7 +41,7 @@ public class ModsPage extends Page { } public void draw(long vg, int x, int y) { - String filter = OneConfigGui.INSTANCE.getSearchValue().toLowerCase().trim(); + String filter = OneConfigGui.INSTANCE == null ? "" : OneConfigGui.INSTANCE.getSearchValue().toLowerCase().trim(); int iX = x + 16; int iY = y + 72; for (ModCard modCard : modCards) { -- cgit