Fix NullPointerException in FastDateParser$TimeZoneStrategy
This commit is contained in:
parent
56907c9a96
commit
5556026ed1
|
@ -853,6 +853,9 @@ static class TimeZoneStrategy extends PatternStrategy {
|
|||
final TimeZone tz = TimeZone.getTimeZone(tzId);
|
||||
for(int i= 1; i<zoneNames.length; ++i) {
|
||||
String zoneName = zoneNames[i];
|
||||
if (zoneName == null) {
|
||||
break;
|
||||
}
|
||||
if (tzNames.put(zoneName.toLowerCase(locale), tz) == null) {
|
||||
simpleQuote(sb.append('|'), zoneName);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,9 @@ public void testTimeZoneStrategyPattern() {
|
|||
for(final String[] zone : zones) {
|
||||
for(int t = 1; t<zone.length; ++t) {
|
||||
final String tzDisplay = zone[t];
|
||||
|
||||
if (tzDisplay == null) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
parser.parse(tzDisplay);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue