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() {
|
||||
try {
|
||||
messages.clear(); // clear message list
|
||||
redrawMessageList();
|
||||
startConnectionHandler();
|
||||
connectionHandler.connect();
|
||||
} catch(ChatProtocolException | IOException e) {
|
||||
|
|
|
@ -14,9 +14,9 @@ public class Message {
|
|||
}
|
||||
|
||||
public boolean matchesFilter(String filter){
|
||||
return sender.contains(filter) ||
|
||||
receiver.contains(filter) ||
|
||||
text.contains(filter);
|
||||
return (sender != null && sender.contains(filter)) ||
|
||||
(receiver != null && receiver.contains(filter)) ||
|
||||
(text != null && text.contains(filter));
|
||||
}
|
||||
|
||||
public MessageType getType() {
|
||||
|
|
Loading…
Reference in New Issue