Always unwrap the optional.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 29 Jun 2013 15:30:22 +0000 (17:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 29 Jun 2013 15:30:22 +0000 (17:30 +0200)
src/main/java/net/pterodactylus/sone/template/ParserFilter.java

index 8833a2d..bd6903b 100644 (file)
@@ -94,7 +94,7 @@ public class ParserFilter implements Filter {
                int cutOffLength = Numbers.safeParseInteger(parameters.get("cut-off-length"), Numbers.safeParseInteger(templateContext.get(String.valueOf(parameters.get("cut-off-length"))), length));
                Object sone = parameters.get("sone");
                if (sone instanceof String) {
-                       sone = core.getSone((String) sone);
+                       sone = core.getSone((String) sone).orNull();
                }
                FreenetRequest request = (FreenetRequest) templateContext.get("request");
                SoneTextParserContext context = new SoneTextParserContext(request, (Sone) sone);