fix crash upon opening hologram gui

This commit is contained in:
Glease committed 2022-09-09 18:09:59 +08:00
1 parent 9bd19b9254
commit 8ee90a7338
1 file changed
+2 -1
@@ -236,7 +236,8 @@ public class GuiScreenConfigureChannels extends GuiScreen implements IGuiScreen
private void updateButtons() {
// this will be called from setText of key and value. NEVER UPDATE THE VALUE OF THESE HERE OR GET A
// STACKOVERFLOW!
boolean existing = ChannelDataAccessor.hasSubChannel(trigger, key.getText());
String keyText = key.getText();
boolean existing = !StringUtils.isEmpty(keyText) && ChannelDataAccessor.hasSubChannel(trigger, keyText);
getButtonList().get(0).displayString = existing
? I18n.format("item.structurelib.constructableTrigger.gui.set")
: I18n.format("item.structurelib.constructableTrigger.gui.add");