logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r732774 - in /logging/log4j/trunk/src: changes/changes.xml main/java/org/apache/log4j/helpers/QuietWriter.java
Date Thu, 08 Jan 2009 18:14:11 GMT
Author: carnold
Date: Thu Jan  8 10:14:11 2009
New Revision: 732774

URL: http://svn.apache.org/viewvc?rev=732774&view=rev
Log:
Bug 46144: QuietWriter.write should check for null argument

Modified:
    logging/log4j/trunk/src/changes/changes.xml
    logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/QuietWriter.java

Modified: logging/log4j/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=732774&r1=732773&r2=732774&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Thu Jan  8 10:14:11 2009
@@ -70,6 +70,7 @@
        <action action="fix" issue="44644">SMTPAppender does not properly encode subject
or content containing non-ASCII characters.</action>
        <action action="fix" issue="46388">Clarify javadoc of Layout.ignoresThrowable.</action>
        <action action="fix" issue="46271">SyslogAppender.append throws exception if
layout is not set.</action>
+       <action action="fix" issue="46144">QuietWriter.write should check for null argument.</action>
     </release>
 
   

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/QuietWriter.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/QuietWriter.java?rev=732774&r1=732773&r2=732774&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/QuietWriter.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/helpers/QuietWriter.java Thu Jan  8
10:14:11 2009
@@ -44,11 +44,13 @@
 
   public
   void write(String string) {
-    try {
-      out.write(string);
-    } catch(IOException e) {
-      errorHandler.error("Failed to write ["+string+"].", e, 
-			 ErrorCode.WRITE_FAILURE);
+    if (string != null) {
+    	try {
+      		out.write(string);
+    	} catch(IOException e) {
+      		errorHandler.error("Failed to write ["+string+"].", e, 
+			 	ErrorCode.WRITE_FAILURE);
+	    }
     }
   }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message