OSDN Git Service

BUGFIX: [ #7449 ] NullPointerException occurred. Cause: When thunderbird received...
authortakuya-o <takuya-o>
Sun, 6 Nov 2005 12:40:24 +0000 (12:40 +0000)
committertakuya-o <takuya-o>
Sun, 6 Nov 2005 12:40:24 +0000 (12:40 +0000)
src/org/jent/checksmtp/Processer.java

index 0174a89..3aecc06 100644 (file)
@@ -207,6 +207,12 @@ public class Processer implements Runnable, ResultNotify {
           while (true) {
             line = clientReader.readLine();
 
+            if (line == null) {
+              //Finish client stream.
+              System.err.println("Client disconnected.");
+              break; //force disconnect.
+            }
+
             if (isRcptTo(line)) {
               //stored To: address.
               toList.add(formatToAddress(line));
@@ -251,6 +257,9 @@ public class Processer implements Runnable, ResultNotify {
             break; // client read while(true);
           }
 
+          if (line == null ) {
+            break;
+          }
           serverWriter.println(line);
           System.out.println(line);
         }