robustness hacks for NNTP
authoradam <adam@megacz.com>
Sat, 15 Apr 2006 05:46:25 +0000 (05:46 +0000)
committeradam <adam@megacz.com>
Sat, 15 Apr 2006 05:46:25 +0000 (05:46 +0000)
darcs-hash:20060415054625-5007d-96a09faf59c260c5d1f8fa4f8c1abadb2e5e9e30.gz

src/org/ibex/mail/protocol/NNTP.java

index bbe4ca7..6d441e7 100644 (file)
@@ -225,12 +225,13 @@ public class NNTP {
                     String groups = command.equals("NEWNEWS") ? st.nextToken() : null;
                     String datetime = st.nextToken() + " " + st.nextToken();
                     String gmt = st.nextToken();
-                    String distributions = gmt.equals("GMT") ? (st.hasMoreTokens() ? st.nextToken() : null) : gmt;
+                    String distributions = gmt.equals("GMT") ? (st.hasMoreTokens() ? st.nextToken() : "") : gmt;
                     while(st.hasMoreTokens()) distributions += " " + st.nextToken();
+
                     // FIXME deal with GMT
                     Date d = new Date();
                     try {
-                        d = new SimpleDateFormat("yyMMDD HHMMSS").parse(gmt);
+                        d = new SimpleDateFormat("yyMMDD HHMMSS").parse(datetime);
                     } catch (ParseException pe) {
                         Log.warn(this, pe);
                     }