SPARK-2369: Prevent NPE in User-has-joined event

This commit is contained in:
Guus der Kinderen 2025-10-10 11:52:51 +02:00
parent 90defcc4bb
commit 27e1d35bce

View File

@ -956,7 +956,9 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
-> { -> {
for (final ChatRoomListener listener : chatRoomListeners) { for (final ChatRoomListener listener : chatRoomListeners) {
try { try {
listener.userHasJoined(room, userid.toString()); if (userid != null) {
listener.userHasJoined(room, userid.toString());
}
} catch (Exception e) { } catch (Exception e) {
Log.error("A ChatRoomListener (" + listener + ") threw an exception while processing a 'user joined' event for user '" + userid + "' in room: " + room, e); Log.error("A ChatRoomListener (" + listener + ") threw an exception while processing a 'user joined' event for user '" + userid + "' in room: " + room, e);
} }