Commit bebbefd5 authored by Dave Cridland's avatar Dave Cridland Committed by daryl herzmann

OF-1137 Check room is not null before logging (#696)

parent 6366c09f
......@@ -781,15 +781,17 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
private void removeChatRoom(String roomName, boolean notify) {
MUCRoom room = rooms.remove(roomName);
Log.info("removing chat room:" + roomName + "|" + room.getClass().getName());
if (room instanceof LocalMUCRoom)
GroupEventDispatcher.removeListener((LocalMUCRoom) room);
if (room != null) {
Log.info("removing chat room:" + roomName + "|" + room.getClass().getName());
if (room instanceof LocalMUCRoom)
GroupEventDispatcher.removeListener((LocalMUCRoom) room);
totalChatTime += room.getChatLength();
if (notify) {
// Notify other cluster nodes that a room has been removed
CacheFactory.doClusterTask(new RoomRemovedEvent((LocalMUCRoom)room));
}
} else {
Log.info("No chat room during removal: " + roomName);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment