From: Felix Dörre Date: Mon, 23 Jun 2014 22:53:21 +0000 (+0200) Subject: Fix a "FindBug" in "EmailChecker" X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=bd001f36f9ae184eae6ffb59305289df8e5aed71 Fix a "FindBug" in "EmailChecker" --- diff --git a/src/org/cacert/gigi/util/EmailChecker.java b/src/org/cacert/gigi/util/EmailChecker.java index 00c6738c..f1e8c367 100644 --- a/src/org/cacert/gigi/util/EmailChecker.java +++ b/src/org/cacert/gigi/util/EmailChecker.java @@ -33,20 +33,21 @@ public class EmailChecker { new InputStreamReader(s.getInputStream())); PrintWriter pw = new PrintWriter(s.getOutputStream())) { String line; - while ((line = br.readLine()).startsWith("220-")) { + while ((line = br.readLine()) != null + && line.startsWith("220-")) { } - - if (!line.startsWith("220")) { + if (line == null || !line.startsWith("220")) { continue; } pw.print("HELO www.cacert.org\r\n"); pw.flush(); - while ((line = br.readLine()).startsWith("220")) { + while ((line = br.readLine()) != null + && line.startsWith("220")) { } - if (!line.startsWith("250")) { + if (line == null || !line.startsWith("250")) { continue; } pw.print("MAIL FROM: \r\n"); @@ -54,7 +55,7 @@ public class EmailChecker { line = br.readLine(); - if (!line.startsWith("250")) { + if (line == null || !line.startsWith("250")) { continue; } pw.print("RCPT TO: <" + address + ">\r\n"); @@ -77,7 +78,7 @@ public class EmailChecker { e.printStackTrace(); } - if (!line.startsWith("250")) { + if (line == null || !line.startsWith("250")) { return line; } else { return OK;