You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/05/10 18:06:36 UTC

[logging-log4j2] branch release-2.x updated: LOG4J2-2824 - Fix NullPointerException in ThreadContextDataInjector

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new e539402  LOG4J2-2824 - Fix NullPointerException in ThreadContextDataInjector
e539402 is described below

commit e5394028c000008505991c45b8ce593422f7ac55
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sun May 10 11:05:54 2020 -0700

    LOG4J2-2824 - Fix NullPointerException in ThreadContextDataInjector
---
 .../apache/logging/log4j/core/impl/ThreadContextDataInjector.java    | 2 +-
 src/changes/changes.xml                                              | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjector.java
index 0522eca..5ce7819 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThreadContextDataInjector.java
@@ -208,7 +208,7 @@ public class ThreadContextDataInjector {
                 // this will replace the LogEvent's context data with the returned instance
                 return providers.get(0).supplyStringMap();
             }
-            int count = props.size();
+            int count = props == null ? 0 : props.size();
             StringMap[] maps = new StringMap[providers.size()];
             for (int i = 0; i < providers.size(); ++i) {
                 maps[i] = providers.get(i).supplyStringMap();
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9c44684..2d1fcf7 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -29,6 +29,11 @@
          - "update" - Change
          - "remove" - Removed
     -->
+    <release version="2.13.3" date="2020-05-10" description="GA Release 2.13.3">
+      <action issue="LOG4J2-2838" dev="rgoers" type="fix">
+        Fix NullPointerException in ThreadContextDataInjector.
+      </action>
+    </release>
     <release version="2.13.2" date="2020-04-23" description="GA Release 2.13.2">
       <action issue="LOG4J2-2824" dev="rgoers" type="fix" due-to="CrazyBills">
         Implement requiresLocation in GelfLayout to reflect whether location information is used in the message Pattern.