You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by dp...@apache.org on 2017/03/15 07:35:52 UTC

svn commit: r1786989 - /logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs

Author: dpsenner
Date: Wed Mar 15 07:35:52 2017
New Revision: 1786989

URL: http://svn.apache.org/viewvc?rev=1786989&view=rev
Log:
TypeNamePatternConverter: added a safety net of null checks to avoid null reference exceptions [LOG4NET-559]

Modified:
    logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs

Modified: logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs?rev=1786989&r1=1786988&r2=1786989&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/TypeNamePatternConverter.cs Wed Mar 15 07:35:52 2017
@@ -48,6 +48,16 @@ namespace log4net.Layout.Pattern
 		/// </remarks>
 		override protected string GetFullyQualifiedName(LoggingEvent loggingEvent) 
 		{
+			if (loggingEvent == null)
+			{
+				return string.Empty;
+			}
+			
+			if (logigngEvent.LocationInformation == null)
+			{
+				return string.Empty;
+			}
+			
 			return loggingEvent.LocationInformation.ClassName;
 		}
 	}