|
|
@@ -424,7 +424,15 @@ public class LifeMessageServiceImpl extends ServiceImpl<LifeMessageMapper, LifeM
|
|
|
String blockerId = JwtUtil.getCurrentUserInfo().getString("userId");
|
|
|
|
|
|
// 查询拉黑
|
|
|
- List<String> lifeBlacklistVoList = lifeBlacklistMapper.getPhoneIdByUserId(blockerType, blockerId).stream().map(LifeBlacklistVo::getPhoneId).collect(Collectors.toList());
|
|
|
+ List<String> lifeBlacklistVoList = lifeBlacklistMapper.getPhoneIdByUserId(blockerType, blockerId)
|
|
|
+ .stream()
|
|
|
+ // 1. 先过滤掉 null 的 LifeBlacklistVo 对象(避免调用 getPhoneId() 时抛 NPE)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ // 2. 调用 getPhoneId() 获取值
|
|
|
+ .map(LifeBlacklistVo::getPhoneId)
|
|
|
+ // 3. 过滤掉 getPhoneId() 返回的 null 值
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
|
// 查询免打扰用户
|
|
|
QueryWrapper<LifeMessageNotDisturb> notDisturbWrapper = new QueryWrapper<>();
|