🐛 消息通知-评论被删除后数据加载失败问题修复

This commit is contained in:
ronger 2021-05-11 15:24:22 +08:00
parent baa49a22e4
commit dad3a1460e

View File

@ -123,6 +123,7 @@ public class NotificationUtils {
case "2": case "2":
// 回帖 // 回帖
comment = commentService.findById(notification.getDataId().toString()); comment = commentService.findById(notification.getDataId().toString());
if (Objects.nonNull(comment)) {
article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0); article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0);
if (Objects.nonNull(article)) { if (Objects.nonNull(article)) {
notificationDTO.setDataTitle(article.getArticleTitle()); notificationDTO.setDataTitle(article.getArticleTitle());
@ -130,6 +131,7 @@ public class NotificationUtils {
user = userService.findById(comment.getCommentAuthorId().toString()); user = userService.findById(comment.getCommentAuthorId().toString());
notificationDTO.setAuthor(genAuthor(user)); notificationDTO.setAuthor(genAuthor(user));
} }
}
break; break;
case "3": case "3":
// 关注用户发布文章 // 关注用户发布文章