From bdfe1f23705a3df86eafed12ac8839ee76662730 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Tue, 25 Aug 2020 14:36:55 -0400 Subject: [PATCH] NIFI-7766 Getting initialize class org.apache.nifi.util.text.RegexDateTimeMatcher error in jsontreereader check for null values returned by getZoneStrings() --- .../org/apache/nifi/util/text/RegexDateTimeMatcher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/text/RegexDateTimeMatcher.java b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/text/RegexDateTimeMatcher.java index fe1b919ba9..48f0774493 100644 --- a/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/text/RegexDateTimeMatcher.java +++ b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/text/RegexDateTimeMatcher.java @@ -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()); + } } }