From 42290bf8231159f5188d4b3c5861aa02f0489c61 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 27 Sep 2022 22:58:31 +0200 Subject: [PATCH] image-dired: Fix header line when file is missing * lisp/image/image-dired.el (image-dired-format-properties-string): Don't error when file has been deleted. --- lisp/image/image-dired.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 98bb6b3c5a1..2c2f24be640 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -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))) + "") 'face 'image-dired-thumb-header-file-size)) (?t . ,(or props "")) (?c . ,(or comment ""))))) -- 2.39.2