用户账号不存在的情况下获取评论报错

This commit is contained in:
2025-04-28 14:51:19 +08:00
parent 200c0adfba
commit 89e6ee9eff

View File

@@ -106,7 +106,11 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
IPage<NotificationVO> convert = notificationPage.convert(o -> {
NotificationVO notificationVO = CopyUtil.copyObject(o, NotificationVO.class);
Account senderAccount = accountService.getById(notificationVO.getSenderId());
notificationVO.setUserName(senderAccount.getUserName());
if (Objects.nonNull(senderAccount)){
notificationVO.setUserName(senderAccount.getUserName());
}else {
notificationVO.setUserName("--");
}
// notificationVO.setSenderUserAvatar(StringUtils.isNullOrEmpty(senderAccount.getAvatar()) ? null : minioUtil.getPreSignedUrl(senderAccount.getAvatar(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
if (Objects.isNull(notificationVO.getPortfolioId())){
notificationVO.setPortfolioId(null);