fix Problem with StringBuilder in ClientMessageList
This commit is contained in:
parent
eb0e6d0dbc
commit
b246c3c7e3
|
@ -189,7 +189,7 @@ public class ChatWindowController {
|
|||
|
||||
private void redrawMessageList() {
|
||||
this.messageArea.clear();
|
||||
Platform.runLater(() -> this.messageArea.appendText(messages.getFilteredMessages(filterValue.getText().strip())));
|
||||
Platform.runLater(() -> this.messageArea.setText(messages.getFilteredMessages(filterValue.getText().strip())));
|
||||
}
|
||||
|
||||
class WindowCloseHandler implements EventHandler<WindowEvent> {
|
||||
|
|
|
@ -12,7 +12,7 @@ public class ClientMessageList {
|
|||
}
|
||||
|
||||
public String getFilteredMessages(String filter) {
|
||||
StringBuilder result = null;
|
||||
StringBuilder result = new StringBuilder();
|
||||
boolean showAll = filter == null || filter.isBlank();
|
||||
for(Message message : messages) {
|
||||
if(showAll || message.matchesFilter(filter))
|
||||
|
|
Loading…
Reference in New Issue