From 405576acaa6e4a9887040a296f8988422351ea3e Mon Sep 17 00:00:00 2001 From: isXander Date: Sun, 18 Sep 2022 21:55:29 +0100 Subject: fix crash when using search --- src/main/java/dev/isxander/yacl/gui/YACLScreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/dev/isxander/yacl/gui') diff --git a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java index fc3984d..cef8fec 100644 --- a/src/main/java/dev/isxander/yacl/gui/YACLScreen.java +++ b/src/main/java/dev/isxander/yacl/gui/YACLScreen.java @@ -142,7 +142,7 @@ public class YACLScreen extends Screen { } public void changeCategory(int idx) { - if (currentCategoryIdx != -1 && config.categories().get(idx) instanceof PlaceholderCategory placeholderCategory) { + if (idx != -1 && config.categories().get(idx) instanceof PlaceholderCategory placeholderCategory) { client.setScreen(placeholderCategory.screen().apply(client, this)); } else { currentCategoryIdx = idx; -- cgit