--- projects/cms/source/util/uk/org/iscream/cms/util/Smtp.java 2001/05/29 17:02:35 1.6 +++ projects/cms/source/util/uk/org/iscream/cms/util/Smtp.java 2002/02/07 17:57:06 1.7 @@ -10,7 +10,7 @@ import java.io.*; * for the GJT, and scaled to do just what we require. * * @author $Author: tdb $ - * @version $Id: Smtp.java,v 1.6 2001/05/29 17:02:35 tdb Exp $ + * @version $Id: Smtp.java,v 1.7 2002/02/07 17:57:06 tdb Exp $ */ public class Smtp { @@ -19,7 +19,7 @@ public class Smtp { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.6 $"; + public static final String REVISION = "$Revision: 1.7 $"; //---STATIC METHODS--- @@ -116,7 +116,10 @@ public class Smtp { public void sendCommand(String cmd, int reply) throws IOException { _socketOut.println(cmd); String temp = _socketIn.readLine(); - if (!temp.startsWith(new Integer(reply).toString())) { + if (temp == null) { + throw new IOException ("IO error reading from socket, connection to server died?"); + } + if (!temp.startsWith(String.valueOf(reply))) { throw new IOException ("Expected " + reply + ", got " + temp); } }