From: David ‘Bombe’ Roden Date: Thu, 9 Jun 2016 05:19:28 +0000 (+0200) Subject: Fix annotations and possible NPEs X-Git-Tag: 0.9.5^2~31 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=244444029d47c3eb11d1dde212757e8332ee5865;p=Sone.git Fix annotations and possible NPEs --- 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); } }; }