From 244444029d47c3eb11d1dde212757e8332ee5865 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 9 Jun 2016 07:19:28 +0200 Subject: [PATCH] Fix annotations and possible NPEs --- src/main/java/net/pterodactylus/sone/notify/PostVisibilityFilter.java | 3 +-- src/main/java/net/pterodactylus/sone/notify/ReplyVisibilityFilter.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/PostVisibilityFilter.java b/src/main/java/net/pterodactylus/sone/notify/PostVisibilityFilter.java index edcd148..3582e3d 100644 --- a/src/main/java/net/pterodactylus/sone/notify/PostVisibilityFilter.java +++ b/src/main/java/net/pterodactylus/sone/notify/PostVisibilityFilter.java @@ -87,10 +87,9 @@ public class PostVisibilityFilter { @Nonnull public Predicate isVisible(@Nullable final Sone currentSone) { return new Predicate() { - @Nonnull @Override public boolean apply(@Nullable Post post) { - return isPostVisible(currentSone, post); + return (post != null) && isPostVisible(currentSone, post); } }; } diff --git a/src/main/java/net/pterodactylus/sone/notify/ReplyVisibilityFilter.java b/src/main/java/net/pterodactylus/sone/notify/ReplyVisibilityFilter.java index a76ae25..fd13779 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ReplyVisibilityFilter.java +++ b/src/main/java/net/pterodactylus/sone/notify/ReplyVisibilityFilter.java @@ -62,10 +62,9 @@ public class ReplyVisibilityFilter { @Nonnull public Predicate isVisible(@Nullable final Sone currentSone) { return new Predicate() { - @Nonnull @Override public boolean apply(@Nullable PostReply postReply) { - return isReplyVisible(currentSone, postReply); + return (postReply != null) && isReplyVisible(currentSone, postReply); } }; } -- 2.7.4