            (get-field doc "num")
            (int (* (.score hits %) 100000))
 	   (concat [:date
-		    (.format *date-output-format*
-			     (DateTools/stringToDate (get-field doc "date")))]
+		    (when (get-field doc "date")
+		      (.format *date-output-format*
+			       (DateTools/stringToDate (get-field doc "date"))))]
 		   (mapcat (fn [f] [(keyword f)
 				    (get-field doc f)])
 			   ["subject" "to" "from" "msgid" "lines" "chars"]))])

             (chatty (format-status (/ msgcount (count to-index))
                                    mps
                                    filename)
                     (try (index-message writer (parse-message filename basedir))
                          (catch java.io.FileNotFoundException e
                            (.println System/err "Oops.  Lost it")))))
           (when (seq fss)
             (recur fss
                    (+ msgcount (count fileset))


       (when optimise
         (chatty "Optimising"
	   (find-deletes index writer)
	   (.optimize writer true)))
       (clojure.set/union updates seen-messages)))
   (catch Exception e
     (.println System/err (str "Agent got exception: " e))
