forked from Archives/Athou_commafeed
add null check to userSessions
This commit is contained in:
@@ -38,7 +38,7 @@ public class WebSocketSessions {
|
||||
|
||||
public void sendMessage(User user, String text) {
|
||||
Set<Session> userSessions = sessions.get(user.getId());
|
||||
if (!userSessions.isEmpty()) {
|
||||
if (userSessions != null && !userSessions.isEmpty()) {
|
||||
log.debug("sending '{}' to {} users via websocket", text, userSessions.size());
|
||||
for (Session userSession : userSessions) {
|
||||
if (userSession.isOpen()) {
|
||||
|
||||
Reference in New Issue
Block a user