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

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

View File

@ -123,12 +123,14 @@ public class NotificationUtils {
case "2":
// 回帖
comment = commentService.findById(notification.getDataId().toString());
article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0);
if (Objects.nonNull(article)) {
notificationDTO.setDataTitle(article.getArticleTitle());
notificationDTO.setDataUrl(comment.getCommentSharpUrl());
user = userService.findById(comment.getCommentAuthorId().toString());
notificationDTO.setAuthor(genAuthor(user));
if (Objects.nonNull(comment)) {
article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0);
if (Objects.nonNull(article)) {
notificationDTO.setDataTitle(article.getArticleTitle());
notificationDTO.setDataUrl(comment.getCommentSharpUrl());
user = userService.findById(comment.getCommentAuthorId().toString());
notificationDTO.setAuthor(genAuthor(user));
}
}
break;
case "3":