From 9fa8fd54c51ff20b47a21dceb45a7acc8a6cc974 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 21 Jun 2011 12:25:42 +0200 Subject: [PATCH] Prevent NPE when no length is given. --- src/main/java/net/pterodactylus/sone/template/ParserFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java index 1bacb8e..74641e9 100644 --- a/src/main/java/net/pterodactylus/sone/template/ParserFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ParserFilter.java @@ -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) { -- 2.7.4