Fix bug: don't signal error if attachment lacks a filename parameter.
authorChris Hanson <org/chris-hanson/cph>
Mon, 5 Jun 2000 13:27:42 +0000 (13:27 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 5 Jun 2000 13:27:42 +0000 (13:27 +0000)
v7/src/imail/imail-top.scm

index 9116a3a703e19e0a1df4a7ec6a59b32cb7c7e83a..afeb93d3de05bd4521c60a04088d1b9d7a0d67ae 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-top.scm,v 1.124 2000/06/03 02:11:02 cph Exp $
+;;; $Id: imail-top.scm,v 1.125 2000/06/05 13:27:42 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
@@ -1572,15 +1572,14 @@ With prefix argument, prompt even when point is on an attachment."
 \f
 (define (save-mime-attachment body selector message buffer)
   (let ((filename
-        (prompt-for-file "Save attachment as"
-                         (list
-                          (merge-pathnames
-                           (filter-mime-attachment-filename
-                            (mime-body-disposition-filename body))
-                           (or (buffer-get buffer
-                                           'IMAIL-MIME-ATTACHMENT-DIRECTORY
-                                           #f)
-                               (buffer-default-directory buffer)))))))
+        (prompt-for-file
+         "Save attachment as"
+         (let ((filename (mime-body-disposition-filename body)))
+           (and filename
+                (list
+                 (merge-pathnames (filter-mime-attachment-filename filename)
+                  (or (buffer-get buffer 'IMAIL-MIME-ATTACHMENT-DIRECTORY #f)
+                      (buffer-default-directory buffer)))))))))
     (if (or (not (file-exists? filename))
            (prompt-for-yes-or-no? "File already exists; overwrite"))
        (begin