bugfix : if current user not logged in,get comments return 500 Internal Server Error
This commit is contained in:
parent
ff0d6ebeec
commit
70e12fd3ae
@ -36,7 +36,7 @@ public class CommentQueryService {
|
||||
|
||||
public List<CommentData> findByArticleId(String articleId, User user) {
|
||||
List<CommentData> comments = commentReadService.findByArticleId(articleId);
|
||||
if (comments.size() > 0) {
|
||||
if (comments.size() > 0 && user != null) {
|
||||
Set<String> followingAuthors = userRelationshipQueryService.followingAuthors(user.getId(), comments.stream().map(commentData -> commentData.getProfileData().getId()).collect(Collectors.toList()));
|
||||
comments.forEach(commentData -> {
|
||||
if (followingAuthors.contains(commentData.getProfileData().getId())) {
|
||||
|
Loading…
Reference in New Issue
Block a user