Fix problem with threads without replies

This commit is contained in:
Andreas Svanberg 2025-04-08 10:28:39 +02:00
parent 79cc561e44
commit cd77921029
2 changed files with 6 additions and 0 deletions
view/src/main/java/se/su/dsv/scipro

@ -24,6 +24,9 @@ public class ProjectForumThread implements ForumThread<ProjectThread> {
@Override
public List<ForumPost> getReplies(final ProjectThread projectThread) {
List<ForumPost> posts = projectForumService.getPosts(projectThread);
if (posts.size() <= 1) {
return List.of();
}
return posts.subList(1, posts.size());
}

@ -24,6 +24,9 @@ public class GroupForumThread implements ForumThread<GroupThread> {
@Override
public List<ForumPost> getReplies(final GroupThread groupThread) {
List<ForumPost> posts = groupForumService.getPosts(groupThread);
if (posts.size() <= 1) {
return List.of();
}
return posts.subList(1, posts.size());
}