Render SonePart as link to WoT profile page if the Sone is unknown.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 27 Sep 2011 11:46:08 +0000 (13:46 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 27 Sep 2011 11:46:08 +0000 (13:46 +0200)
src/main/java/net/pterodactylus/sone/template/ParserFilter.java

index 3494c21..42e4035 100644 (file)
@@ -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");
+               }
        }
 
        /**