Fix: (ement-room-image-show) Handle invalid images

This commit is contained in:
Adam Porter 2021-07-29 18:07:56 -05:00
parent 28528ebdbd
commit 62a740aa9d

View file

@ -1705,6 +1705,7 @@ show it in the buffer."
(if (and ement-room-images image)
;; Images enabled and image downloaded: create image and
;; return it in a string.
(condition-case err
(let ((image (create-image image nil 'data-p :ascent 'center))
(buffer-window (when buffer
(get-buffer-window buffer)))
@ -1724,6 +1725,7 @@ show it in the buffer."
(concat "\n"
(propertize " " 'display image
'keymap ement-room-image-keymap)))
(error (format "\n [error inserting image: %s]" (error-message-string err))))
;; Image not downloaded: insert URL as button, and download if enabled.
(prog1
(with-temp-buffer