From: David ‘Bombe’ Roden Date: Tue, 21 Jun 2011 10:25:42 +0000 (+0200) Subject: Prevent NPE when no length is given. X-Git-Tag: 0.6.6^2~55 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9fa8fd54c51ff20b47a21dceb45a7acc8a6cc974;p=Sone.git Prevent NPE when no length is given. --- 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) {