Fix NPE in text field if no text-change-listener is set

This commit is contained in:
johni0702
2015-11-14 14:11:09 +01:00
parent 0623bcaac5
commit eeeb986502

View File

@@ -121,7 +121,9 @@ public abstract class AbstractGuiTextField<T extends AbstractGuiTextField<T>>
wrapped.textboxKeyTyped(keyChar, keyCode);
String after = wrapped.getText();
if (!before.equals(after)) {
textChanged.run();
if (textChanged != null) {
textChanged.run();
}
}
return true;
}