Index: lisp/spam.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v retrieving revision 6.146.2.22 diff -u -p -r6.146.2.22 spam.el --- lisp/spam.el 24 Jan 2007 07:17:41 -0000 6.146.2.22 +++ lisp/spam.el 1 Aug 2007 12:52:36 -0000 @@ -1108,22 +1108,23 @@ functions") (spam-list-articles gnus-newsgroup-articles classification))) - ;; process them - (gnus-message 5 "%s %d %s articles with classification %s, check %s" - (if unregister "Unregistering" "Registering") - (length articles) - (if specific-articles "specific" "") - (symbol-name classification) - (symbol-name check)) - (funcall run-function articles) - ;; now log all the registrations (or undo them, depending on unregister) - (dolist (article articles) - (funcall log-function - (spam-fetch-field-message-id-fast article) - 'process - classification - check - gnus-newsgroup-name)))))) + (when articles + ;; process them + (gnus-message 5 "%s %d %s articles with classification %s, check %s" + (if unregister "Unregistering" "Registering") + (length articles) + (if specific-articles "specific" "") + (symbol-name classification) + (symbol-name check)) + (funcall run-function articles) + ;; now log all the registrations (or undo them, depending on unregister) + (dolist (article articles) + (funcall log-function + (spam-fetch-field-message-id-fast article) + 'process + classification + check + gnus-newsgroup-name))))))) ;;; log a ham- or spam-processor invocation to the registry (defun spam-log-processing-to-registry (id type classification check group)