|
@@ -135,8 +135,10 @@ public class ChatSessionServiceImpl extends ServiceImpl<ChatSessionMapper, ChatS
|
|
|
List<ChatSessionEntity> list = sessionMapper.findDBListByUserId(query.getUserId());
|
|
|
list.forEach(entity -> {
|
|
|
RoomInfo roomInfo = redis.get("ROOM:" + entity.getSessionid(), RoomInfo.class);
|
|
|
- entity.setLastMsg(roomInfo.getLastChat());
|
|
|
- entity.setLastTime(roomInfo.getLastTime());
|
|
|
+ if (null != roomInfo){
|
|
|
+ entity.setLastMsg(roomInfo.getLastChat());
|
|
|
+ entity.setLastTime(roomInfo.getLastTime());
|
|
|
+ }
|
|
|
});
|
|
|
Collections.sort(list, (ent1, ent2) -> ent2.getLastTime().compareTo(ent1.getLastTime()));
|
|
|
|