[
https://issues.apache.org/jira/browse/LOG4J2-1227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15066613#comment-15066613
]
ASF GitHub Bot commented on LOG4J2-1227:
----------------------------------------
GitHub user olivierlemasle opened a pull request:
https://github.com/apache/logging-log4j2/pull/20
LOG4J2-1227
Test if the event is null before using it, to avoid NullPointerException.
Add some unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/olivierlemasle/logging-log4j2 LOG4J2-1227
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/logging-log4j2/pull/20.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20
----
commit 33ee4bfd0aa1f58a705771222132a42d1dfb328c
Author: Olivier Lemasle <[email protected]>
Date: 2015-12-21T15:53:36Z
LOG4J2-1227
Test if the event is null before using it, to avoid
NullPointerException.
Add some unit tests.
Submitted by: Olivier Lemasle <[email protected]>
----
> NullPointerException in MapLookup.lookup is the event is null
> -------------------------------------------------------------
>
> Key: LOG4J2-1227
> URL: https://issues.apache.org/jira/browse/LOG4J2-1227
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.4, 2.4.1, 2.5
> Reporter: Olivier Lemasle
> Fix For: 2.5.1
>
>
> A NullPointerException is thrown in
> org.apache.logging.log4j.core.lookup.MapLookup.lookup, when the event is null
> and the map is not null.
> The event can indeed be null, for example if used from StrSubstitutor, with
> the method replace(final StringBuilder source).
> Exception:
> java.lang.NullPointerException: null
> at
> org.apache.logging.log4j.core.lookup.MapLookup.lookup(MapLookup.java:121)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]