From: David ‘Bombe’ Roden Date: Fri, 25 Jan 2013 17:19:33 +0000 (+0100) Subject: Only list replies whose posts exist. X-Git-Tag: 0.8.5^2~3^2~56 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f30eb5d4dbcd631aaff76a5e52a3d4cbe8d10c27;p=Sone.git Only list replies whose posts exist. --- diff --git a/src/main/java/net/pterodactylus/sone/web/NewPage.java b/src/main/java/net/pterodactylus/sone/web/NewPage.java index 22d27c8..71200d8 100644 --- a/src/main/java/net/pterodactylus/sone/web/NewPage.java +++ b/src/main/java/net/pterodactylus/sone/web/NewPage.java @@ -23,6 +23,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import com.google.common.collect.Collections2; + import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.notify.ListNotificationFilters; @@ -66,7 +68,7 @@ public class NewPage extends SoneTemplatePage { /* collect new elements from notifications. */ Set posts = new HashSet(webInterface.getNewPosts()); - for (PostReply reply : webInterface.getNewReplies()) { + for (PostReply reply : Collections2.filter(webInterface.getNewReplies(), PostReply.HAS_POST_FILTER)) { posts.add(reply.getPost().get()); }