logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1490136 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
Date Thu, 06 Jun 2013 04:57:37 GMT
Author: ggregory
Date: Thu Jun  6 04:57:37 2013
New Revision: 1490136

URL: http://svn.apache.org/r1490136
Log:
Avoid unlikely but possible NPE when readLine() returns null.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java?rev=1490136&r1=1490135&r2=1490136&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
Thu Jun  6 04:57:37 2013
@@ -98,7 +98,7 @@ public class SocketServer extends Abstra
         final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in,
enc));
         while (true) {
             final String line = reader.readLine();
-            if (line.equalsIgnoreCase("Quit") || line.equalsIgnoreCase("Stop") || line.equalsIgnoreCase("Exit"))
{
+            if (line == null || line.equalsIgnoreCase("Quit") || line.equalsIgnoreCase("Stop")
|| line.equalsIgnoreCase("Exit")) {
                 sserver.shutdown();
                 server.join();
                 break;



Mime
View raw message