check length first in timestamp parser

This commit is contained in:
Daniel Gultsch 2017-07-16 21:03:59 +02:00
parent febee9863f
commit 0a20b87ebe
1 changed files with 1 additions and 1 deletions

View File

@ -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);