Don’t link to unknown posts.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 28 Apr 2011 04:44:31 +0000 (06:44 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 28 Apr 2011 04:44:31 +0000 (06:44 +0200)
src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java

index 0f6887d..4b88acc 100644 (file)
@@ -265,7 +265,7 @@ public class FreenetLinkParser implements Parser<FreenetLinkParserContext> {
                                        } else if (linkType == LinkType.POST) {
                                                String postId = link.substring(7);
                                                Post post = core.getPost(postId, false);
-                                               if (post != null) {
+                                               if ((post != null) && (post.getSone() != null)) {
                                                        String postText = post.getText();
                                                        postText = postText.substring(0, Math.min(postText.length(), 20)) + "…";
                                                        Sone postSone = post.getSone();