X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostFeedCommand.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostFeedCommand.java;h=b22d356694f6b4d9b0ea087712ab7d4fc0c26b03;hp=0fc7eda031e381cdaf55e82acb19cdb8f7514821;hb=45803a1c678d6811f7bbf85d50c79844031be0f0;hpb=33cc85447797301e299e7ac444fe53538f09a69d diff --git a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java index 0fc7eda..b22d356 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/GetPostFeedCommand.java @@ -28,6 +28,7 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.freenet.fcp.FcpException; +import com.google.common.base.Optional; import com.google.common.collect.Collections2; import freenet.support.SimpleFieldSet; @@ -63,10 +64,11 @@ public class GetPostFeedCommand extends AbstractSoneCommand { Collection allPosts = new HashSet(); allPosts.addAll(sone.getPosts()); for (String friendSoneId : sone.getFriends()) { - if (!getCore().hasSone(friendSoneId)) { + Optional friendSone = getCore().getSone(friendSoneId); + if (!friendSone.isPresent()) { continue; } - allPosts.addAll(getCore().getSone(friendSoneId).getPosts()); + allPosts.addAll(friendSone.get().getPosts()); } allPosts.addAll(getCore().getDirectedPosts(sone.getId())); allPosts = Collections2.filter(allPosts, Post.FUTURE_POSTS_FILTER);