robustness hacks for NNTP
[org.ibex.mail.git] / 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);
                     }