Browse Source

修复im-server空指针异常的问题

master
xie.bx 3 years ago
parent
commit
1b72be4ff7
  1. 12
      im-server/src/main/java/com/bx/imserver/websocket/WebsocketChannelCtxHolder.java

12
im-server/src/main/java/com/bx/imserver/websocket/WebsocketChannelCtxHolder.java

@ -18,16 +18,16 @@ public class WebsocketChannelCtxHolder {
}
public static void removeChannelCtx(Long userId){
channelMap.remove(userId);
if(userId != null){
channelMap.remove(userId);
}
}
public static ChannelHandlerContext getChannelCtx(Long userId){
if(userId == null){
return null;
}
return channelMap.get(userId);
}
public static Set<Long> getAllChannelIds(){
return channelMap.keySet();
}
}

Loading…
Cancel
Save