only update search text when there are items

Closes #19
This commit is contained in:
Ellpeck 2020-05-17 16:24:24 +02:00
parent a026cfc550
commit 718cef5c4e

View file

@ -112,10 +112,12 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
this.minusButton.active = this.requestAmount > 1;
this.search.tick();
String text = this.search.getText();
if (!this.lastSearchText.equals(text)) {
this.lastSearchText = text;
this.updateWidgets();
if (this.items != null) {
String text = this.search.getText();
if (!this.lastSearchText.equals(text)) {
this.lastSearchText = text;
this.updateWidgets();
}
}
}