You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/03/23 00:37:31 UTC

logging-log4j2 git commit: FIX NPE in RingBufferLogEventTest

Repository: logging-log4j2
Updated Branches:
  refs/heads/master a0a4e43e2 -> 20be2b03d


FIX NPE in RingBufferLogEventTest


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/20be2b03
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/20be2b03
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/20be2b03

Branch: refs/heads/master
Commit: 20be2b03dd82875a225f1ecb607edf3ed1896587
Parents: a0a4e43
Author: rpopma <rp...@apache.org>
Authored: Wed Mar 23 08:37:27 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Wed Mar 23 08:37:27 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/async/RingBufferLogEvent.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/20be2b03/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
index 10347a3..a241f0a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/RingBufferLogEvent.java
@@ -163,7 +163,7 @@ public class RingBufferLogEvent implements LogEvent {
             ((ReusableMessage) msg).formatTo(getMessageTextForWriting());
         } else {
             // if the Message instance is reused, there is no point in freezing its message here
-            if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND) { // LOG4J2-898: user may choose
+            if (!Constants.FORMAT_MESSAGES_IN_BACKGROUND && msg != null) { // LOG4J2-898: user may choose
                 msg.getFormattedMessage(); // LOG4J2-763: ask message to freeze parameters
             }
             this.message = msg;