@Nonnull
public Predicate<Post> isVisible(@Nullable final Sone currentSone) {
return new Predicate<Post>() {
- @Nonnull
@Override
public boolean apply(@Nullable Post post) {
- return isPostVisible(currentSone, post);
+ return (post != null) && isPostVisible(currentSone, post);
}
};
}
@Nonnull
public Predicate<PostReply> isVisible(@Nullable final Sone currentSone) {
return new Predicate<PostReply>() {
- @Nonnull
@Override
public boolean apply(@Nullable PostReply postReply) {
- return isReplyVisible(currentSone, postReply);
+ return (postReply != null) && isReplyVisible(currentSone, postReply);
}
};
}