From: David ‘Bombe’ Roden Date: Fri, 24 Jul 2015 04:31:39 +0000 (+0200) Subject: Don’t clobber title with “null,” either X-Git-Tag: 0.9.4^2~11 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=970ba72656ea47934b43373bbb6945882dfd4a9b;p=Sone.git Don’t clobber title with “null,” either --- diff --git a/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java b/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java index 1ac7360..65e8cdb 100644 --- a/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ImageLinkFilter.java @@ -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);