Skip to content

Commit a847807

Browse files
ALongStringOfNumbersbrachy84
authored andcommitted
Fixes the Text Changed String check (CleanroomMC#170)
* Fixes the Text Changed String check * Change to use Objects.equals() (cherry picked from commit 1abacfa)
1 parent ff799e9 commit a847807

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/cleanroommc/modularui/widgets/TextWidget.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import org.jetbrains.annotations.Nullable;
1616

17+
import java.util.Objects;
1718
import java.util.function.IntSupplier;
1819

1920
public class TextWidget<W extends TextWidget<W>> extends Widget<W> {
@@ -52,7 +53,7 @@ public void draw(ModularGuiContext context, WidgetThemeEntry<?> widgetTheme) {
5253

5354
protected String checkString() {
5455
String text = this.key.getFormatted();
55-
if (this.lastText != null && !this.lastText.equals(text)) {
56+
if (!Objects.equals(this.lastText, text)) {
5657
onTextChanged(text);
5758
this.lastText = text;
5859
}

0 commit comments

Comments
 (0)