SOLR-3706: avoid NPE (merge from 4x)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1521739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2013-09-11 05:53:39 +00:00
parent bd4f9b9896
commit a338f097c6
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ public class Log4jWatcher extends LogWatcher<LoggingEvent> {
doc.setField("time", new Date(event.getTimeStamp()));
doc.setField("level", event.getLevel().toString());
doc.setField("logger", event.getLogger().getName());
doc.setField("message", event.getMessage().toString());
doc.setField("message", event.getMessage() + ""); // avoid NPE when we have an event with null message
ThrowableInformation t = event.getThrowableInformation();
if(t!=null) {
doc.setField("trace", Throwables.getStackTraceAsString(t.getThrowable()));