Commit 60a47a7d authored by R.W.Majeed's avatar R.W.Majeed

fixed NPE during error message for short/incomplete dates

parent 3963d544
...@@ -342,7 +342,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> { ...@@ -342,7 +342,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> {
ParsePosition pos = new ParsePosition(0); ParsePosition pos = new ParsePosition(0);
TemporalAccessor a = formatter.parseUnresolved(text, pos); TemporalAccessor a = formatter.parseUnresolved(text, pos);
if( pos.getErrorIndex() != -1 ){ if( pos.getErrorIndex() != -1 ){
throw new DateTimeParseException("Text '"+String.valueOf(text.charAt(pos.getErrorIndex()))+"' could not be parsed at index "+pos.getErrorIndex(), text, pos.getErrorIndex()); throw new DateTimeParseException("Text '"+text+"' could not be parsed at index "+pos.getErrorIndex(), text, pos.getErrorIndex());
}else if( pos.getIndex() != text.length() ){ }else if( pos.getIndex() != text.length() ){
throw new DateTimeParseException("Unparsed text found at index "+pos.getIndex(), text, pos.getIndex()); throw new DateTimeParseException("Unparsed text found at index "+pos.getIndex(), text, pos.getIndex());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment