Skip to content

Commit 1b8b8d8

Browse files
authored
Fix NPE in ContextSelector.getContext() (apache#1538 LOG4J2-3217)
1 parent 83bba1b commit 1b8b8d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ContextSelector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ default LoggerContext getContext(String fqcn, ClassLoader loader, Map.Entry<Stri
108108
default LoggerContext getContext(String fqcn, ClassLoader loader, Map.Entry<String, Object> entry,
109109
boolean currentContext, URI configLocation) {
110110
final LoggerContext lc = getContext(fqcn, loader, currentContext, configLocation);
111-
if (lc != null) {
111+
if (lc != null && entry != null) {
112112
lc.putObject(entry.getKey(), entry.getValue());
113113
}
114114
return lc;

0 commit comments

Comments
 (0)