From be70cb1fb5dfa0296facac78b05b62726214b484 Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Thu, 1 Aug 2013 16:27:17 +0200 Subject: [PATCH] (mml2015-epg-key-image-to-string): Protect against bugging out on ttys. --- lisp/ChangeLog | 5 +++++ lisp/mml2015.el | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35dd9a85d..8d9d4567a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-08-01 David Edmondson + + * mml2015.el (mml2015-epg-key-image-to-string): Protect against bugging + out on ttys. + 2013-08-01 Lars Magne Ingebrigtsen * gnus-start.el (gnus-dribble-save): Only save the dribble file if it's diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 2c2187a5f..3efa5c23b 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -885,17 +885,19 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (defun mml2015-epg-key-image-to-string (key-id) "Return a string with the image of a key, if any" - (let* ((result "") - (key-image (mml2015-epg-key-image key-id))) - (when key-image - (setq result " ") - (put-text-property - 1 2 'display - (gnus-rescale-image key-image - (cons mml2015-maximum-key-image-dimension - mml2015-maximum-key-image-dimension)) - result)) - result)) + (let ((key-image (mml2015-epg-key-image key-id))) + (if (not key-image) + "" + (condition-case error + (let ((result " ")) + (put-text-property + 1 2 'display + (gnus-rescale-image key-image + (cons mml2015-maximum-key-image-dimension + mml2015-maximum-key-image-dimension)) + result) + result) + (error ""))))) (defun mml2015-epg-signature-to-string (signature) (concat (epg-signature-to-string signature) -- 2.25.1