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

fixed NPE during error message for short/incomplete dates

parent 3963d544
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> {
		ParsePosition pos = new ParsePosition(0);
		TemporalAccessor a = formatter.parseUnresolved(text, pos);
		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() ){
			throw new DateTimeParseException("Unparsed text found at index "+pos.getIndex(), text, pos.getIndex());
		}