Solved Problem "Empty Messages can be sent"

This commit is contained in:
schrom01 2022-04-12 10:00:31 +02:00
parent 424a174847
commit 3082da8a91
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ public class ClientConnectionHandler implements Runnable {
if (state != CONNECTED) throw new ChatProtocolException("Illegal state for message: " + state);
Matcher matcher = messagePattern.matcher(messageString);
if (matcher.find()) {
if (messageString != "" && matcher.find()) {
String receiver = matcher.group(1);
String message = matcher.group(2);
if (receiver == null || receiver.isBlank()) receiver = ClientConnectionHandler.USER_ALL;