* lisp/emacs-lisp/icons.el (icons--create): Handle the case when
ICON is a file that doesn't exists or is unreadable. Suggested by
David Ponce <da_vid@orange.fr>. (Bug#66846)
merged)
(cl-defmethod icons--create ((_type (eql 'image)) icon keywords)
- (let ((file (if (file-name-absolute-p icon)
- icon
- (and (fboundp 'image-search-load-path)
- (image-search-load-path icon)))))
- (and (display-images-p)
+ (let* ((file (if (file-name-absolute-p icon)
+ icon
+ (and (fboundp 'image-search-load-path)
+ (image-search-load-path icon))))
+ (file-exists (and (stringp file) (file-readable-p file))))
+ (and file-exists
+ (display-images-p)
(fboundp 'image-supported-file-p)
(image-supported-file-p file)
(propertize