From 0a20b87ebefe0c6fe565e91e10f62851d60d712e Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 16 Jul 2017 21:03:59 +0200 Subject: [PATCH] check length first in timestamp parser --- src/main/java/eu/siacs/conversations/parser/AbstractParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java index 384e87d1e..50ad7f38c 100644 --- a/src/main/java/eu/siacs/conversations/parser/AbstractParser.java +++ b/src/main/java/eu/siacs/conversations/parser/AbstractParser.java @@ -68,7 +68,7 @@ public abstract class AbstractParser { timestamp = timestamp.replace("Z", "+0000"); SimpleDateFormat dateFormat; long ms; - if (timestamp.charAt(19) == '.' && timestamp.length() >= 25) { + if (timestamp.length() >= 25 && timestamp.charAt(19) == '.') { String millis = timestamp.substring(19,timestamp.length() - 5); try { double fractions = Double.parseDouble("0" + millis);