fixed matchesFilter in Message.java
Problem solved if any String is null.
This commit is contained in:
parent
3082da8a91
commit
7e7333dfaf
|
@ -62,6 +62,7 @@ public class ChatWindowController {
|
||||||
private void connect() {
|
private void connect() {
|
||||||
try {
|
try {
|
||||||
messages.clear(); // clear message list
|
messages.clear(); // clear message list
|
||||||
|
redrawMessageList();
|
||||||
startConnectionHandler();
|
startConnectionHandler();
|
||||||
connectionHandler.connect();
|
connectionHandler.connect();
|
||||||
} catch(ChatProtocolException | IOException e) {
|
} catch(ChatProtocolException | IOException e) {
|
||||||
|
|
|
@ -14,9 +14,9 @@ public class Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matchesFilter(String filter){
|
public boolean matchesFilter(String filter){
|
||||||
return sender.contains(filter) ||
|
return (sender != null && sender.contains(filter)) ||
|
||||||
receiver.contains(filter) ||
|
(receiver != null && receiver.contains(filter)) ||
|
||||||
text.contains(filter);
|
(text != null && text.contains(filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageType getType() {
|
public MessageType getType() {
|
||||||
|
|
Loading…
Reference in New Issue