Prevent NPE when no length is given.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jun 2011 10:25:42 +0000 (12:25 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jun 2011 10:25:42 +0000 (12:25 +0200)
src/main/java/net/pterodactylus/sone/template/ParserFilter.java

index 1bacb8e..74641e9 100644 (file)
@@ -93,7 +93,7 @@ public class ParserFilter implements Filter {
                } catch (NumberFormatException nfe1) {
                        /* ignore. */
                }
-               if (length == -1) {
+               if ((length == -1) && (parameters.get("length") != null)) {
                        try {
                                length = Integer.parseInt(String.valueOf(templateContext.get(parameters.get("length"))));
                        } catch (NumberFormatException nfe1) {