From: David ‘Bombe’ Roden Date: Thu, 28 Apr 2011 04:44:31 +0000 (+0200) Subject: Don’t link to unknown posts. X-Git-Tag: 0.6.3^2~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=99f81eb82982d630a9a9990e27c7cc8ea30563ce;p=Sone.git Don’t link to unknown posts. --- diff --git a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java index 0f6887d..4b88acc 100644 --- a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java +++ b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java @@ -265,7 +265,7 @@ public class FreenetLinkParser implements Parser { } 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();