From: David ‘Bombe’ Roden Date: Tue, 27 Sep 2011 11:46:08 +0000 (+0200) Subject: Render SonePart as link to WoT profile page if the Sone is unknown. X-Git-Tag: 0.7.2^2~24 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=66a45de8c5f247d03382a570e960ac3e8cee8c79 Render SonePart as link to WoT profile page if the Sone is unknown. --- diff --git a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java index 3494c21..42e4035 100644 --- a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java @@ -233,7 +233,11 @@ public class ParserFilter implements Filter { * The part to render */ private void render(Writer writer, SonePart sonePart) { - renderLink(writer, "viewSone.html?sone=" + sonePart.getSone().getId(), SoneAccessor.getNiceName(sonePart.getSone()), SoneAccessor.getNiceName(sonePart.getSone()), "in-sone"); + if ((sonePart.getSone() != null) && (sonePart.getSone().getName() != null)) { + renderLink(writer, "viewSone.html?sone=" + sonePart.getSone().getId(), SoneAccessor.getNiceName(sonePart.getSone()), SoneAccessor.getNiceName(sonePart.getSone()), "in-sone"); + } else { + renderLink(writer, "/WebOfTrust/ShowIdentity?id=" + sonePart.getSone().getId(), sonePart.getSone().getId(), sonePart.getSone().getId(), "in-sone"); + } } /**