]> git.eshelyaron.com Git - emacs.git/commitdiff
image-dired: Fix header line when file is missing
authorStefan Kangas <stefankangas@gmail.com>
Tue, 27 Sep 2022 20:58:31 +0000 (22:58 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 27 Sep 2022 20:59:42 +0000 (22:59 +0200)
* lisp/image/image-dired.el
(image-dired-format-properties-string): Don't error when file has
been deleted.

lisp/image/image-dired.el

index 98bb6b3c5a1f4472ccec1e8e3496696796ec52f9..2c2f24be6403995d40cd5a033997275ed6604931 100644 (file)
@@ -768,9 +768,11 @@ comment."
                         'face 'image-dired-thumb-header-file-name))
      (?n . ,(propertize image-count
                         'face 'image-dired-thumb-header-image-count))
-     (?s . ,(propertize (file-size-human-readable
-                         (file-attribute-size
-                          (file-attributes file)))
+     (?s . ,(propertize (if (file-exists-p file)
+                            (file-size-human-readable
+                             (file-attribute-size
+                              (file-attributes file)))
+                          "<File missing>")
                         'face 'image-dired-thumb-header-file-size))
      (?t . ,(or props ""))
      (?c . ,(or comment "")))))