1
0

Fix NullPointerException in SimpleLog#write(Object) on null input

This commit is contained in:
Gary Gregory
2024-06-30 08:01:52 -04:00
parent b31e91cba5
commit 825105628f
2 changed files with 3 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ The <action> type attribute can be add,update,fix,remove.
<!-- FIX --> <!-- FIX -->
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in SimpleLog.</action> <action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in SimpleLog.</action>
<action dev="ggregory" type="fix" issue="LOGGING-193" due-to="Philippe Marschall">Update Log4j 2 Imports #268.</action> <action dev="ggregory" type="fix" issue="LOGGING-193" due-to="Philippe Marschall">Update Log4j 2 Imports #268.</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix NullPointerException in SimpleLog#write(Object) on null input.</action>
<!-- ADD --> <!-- ADD -->
<!-- UPDATE --> <!-- UPDATE -->
<action dev="ggregory" type="update" due-to="Dependabot">Bump org.apache.commons:commons-parent from 69 to 71 #267.</action> <action dev="ggregory" type="update" due-to="Dependabot">Bump org.apache.commons:commons-parent from 69 to 71 #267.</action>

View File

@@ -27,6 +27,7 @@ import java.security.PrivilegedAction;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Objects;
import java.util.Properties; import java.util.Properties;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@@ -640,7 +641,7 @@ public class SimpleLog implements Log, Serializable {
* text to be logged * text to be logged
*/ */
private void write(final Object buffer) { private void write(final Object buffer) {
System.err.println(buffer.toString()); System.err.println(Objects.toString(buffer));
} }
/** /**