Replace Reader with String in Parser interface
[Sone.git] / src / main / java / net / pterodactylus / sone / template / ImageLinkFilter.java
index 1ac7360..f560731 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - ImageLinkFilter.java - Copyright © 2011–2013 David Roden
+ * Sone - ImageLinkFilter.java - Copyright © 2011–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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);