X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotificationFilters.java;h=dbf09a350651199cda5738bc783538036c26994c;hp=1881a1b681e4936704fac382773997ea8e5aebf0;hb=9e8b1de83b5791778788406edbba9ed6d256a63f;hpb=cf16e1fef9f9db74f50fb1d12dbc48a552ec2a1a diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java index 1881a1b..dbf09a3 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilters.java @@ -31,6 +31,8 @@ import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.freenet.wot.Trust; import net.pterodactylus.util.notify.Notification; +import com.google.common.base.Optional; + /** * Filter for {@link ListNotification}s. * @@ -282,11 +284,11 @@ public class ListNotificationFilters { */ public static boolean isReplyVisible(Sone sone, PostReply reply) { checkNotNull(reply, "reply must not be null"); - Post post = reply.getPost(); - if (post == null) { + Optional post = reply.getPost(); + if (!post.isPresent()) { return false; } - if (!isPostVisible(sone, post)) { + if (!isPostVisible(sone, post.get())) { return false; } if (reply.getTime() > System.currentTimeMillis()) {