(mml2015-epg-key-image-to-string): Protect against bugging out on ttys.
authorDavid Edmondson <dme@dme.org>
Thu, 1 Aug 2013 14:27:17 +0000 (16:27 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 1 Aug 2013 14:27:17 +0000 (16:27 +0200)
lisp/ChangeLog
lisp/mml2015.el

index 35dd9a8..8d9d456 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-01  David Edmondson  <dme@dme.org>
+
+       * mml2015.el (mml2015-epg-key-image-to-string): Protect against bugging
+       out on ttys.
+
 2013-08-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-start.el (gnus-dribble-save): Only save the dribble file if it's
index 2c2187a..3efa5c2 100644 (file)
@@ -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)