diff --git a/src/main/java/run/halo/app/content/impl/PostServiceImpl.java b/src/main/java/run/halo/app/content/impl/PostServiceImpl.java index 60419200c2..f729684e38 100644 --- a/src/main/java/run/halo/app/content/impl/PostServiceImpl.java +++ b/src/main/java/run/halo/app/content/impl/PostServiceImpl.java @@ -93,7 +93,7 @@ Predicate postListPredicate(PostQuery query) { Predicate paramPredicate = post -> contains(query.getCategories(), post.getSpec().getCategories()) && contains(query.getTags(), post.getSpec().getTags()) - && contains(query.getContributors(), post.getStatus().getContributors()); + && contains(query.getContributors(), post.getStatusOrDefault().getContributors()); String keyword = query.getKeyword(); if (keyword != null) { @@ -159,7 +159,7 @@ private Mono getListedPost(Post post) { }) .flatMap(lp -> setTags(post.getSpec().getTags(), lp)) .flatMap(lp -> setCategories(post.getSpec().getCategories(), lp)) - .flatMap(lp -> setContributors(post.getStatus().getContributors(), lp)) + .flatMap(lp -> setContributors(post.getStatusOrDefault().getContributors(), lp)) .flatMap(lp -> setOwner(post.getSpec().getOwner(), lp)); } diff --git a/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java b/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java index 66b38227e5..e6d2c4811e 100644 --- a/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java +++ b/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java @@ -14,7 +14,6 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.context.ApplicationContext; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import org.springframework.security.core.context.SecurityContext; @@ -61,8 +60,6 @@ public class SinglePageServiceImpl implements SinglePageService { private final CounterService counterService; - private final ApplicationContext applicationContext; - @Override public Mono> list(SinglePageQuery query) { Comparator comparator =