Skip to content

Commit 75a5b04

Browse files
Fix(#3239) NPE, for RegexFilter creator.
1 parent be2d145 commit 75a5b04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public static RegexFilter createFilter(
148148
LOGGER.error("A regular expression must be provided for RegexFilter");
149149
return null;
150150
}
151-
return new RegexFilter(useRawMsg, Pattern.compile(regex, toPatternFlags(patternFlags)), match, mismatch);
151+
return new RegexFilter(
152+
useRawMsg != null && useRawMsg, Pattern.compile(regex, toPatternFlags(patternFlags)), match, mismatch);
152153
}
153154

154155
private static int toPatternFlags(final String[] patternFlags)

0 commit comments

Comments
 (0)