Don’t clobber title with “null,” either
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 24 Jul 2015 04:31:39 +0000 (06:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 24 Jul 2015 04:31:39 +0000 (06:31 +0200)
src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java

index 1ac7360..65e8cdb 100644 (file)
@@ -84,7 +84,7 @@ public class ImageLinkFilter implements Filter {
                int maxWidth = parseInt(valueOf(parameters.get("max-width")), MAX_VALUE);
                int maxHeight = parseInt(valueOf(parameters.get("max-height")), MAX_VALUE);
                String mode = valueOf(parameters.get("mode"));
-               String title = valueOf(parameters.get("title"));
+               String title = Optional.fromNullable(parameters.get("title")).transform(getStringValue()).orNull();
 
                TemplateContext linkTemplateContext = templateContextFactory.createTemplateContext();
                linkTemplateContext.set("class", imageClass);