NIFI-7766 Getting initialize class org.apache.nifi.util.text.RegexDateTimeMatcher error in jsontreereader

check for null values returned by getZoneStrings()
This commit is contained in:
Otto Fowler 2020-08-25 14:36:55 -04:00 committed by markap14
parent aaab9ee0cf
commit bdfe1f2370
1 changed files with 4 additions and 3 deletions

View File

@ -131,9 +131,10 @@ public class RegexDateTimeMatcher implements DateTimeMatcher {
final StringBuilder zoneNamePatternBuilder = new StringBuilder();
for (final String[] zoneNames : zoneStrings) {
for (final String zoneName : zoneNames) {
zoneNamePatternBuilder.append(Pattern.quote(zoneName)).append("|");
maxTimeZoneLength = Math.max(maxTimeZoneLength, zoneName.length());
if (zoneName != null && !zoneName.isEmpty()) {
zoneNamePatternBuilder.append(Pattern.quote(zoneName)).append("|");
maxTimeZoneLength = Math.max(maxTimeZoneLength, zoneName.length());
}
}
}