Merge pull request #2 from VilenEera/bugfix
if current user not logged in,get comments return 500 Internal Server Error
This commit is contained in:
commit
08024fcc6f
@ -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