summaryrefslogtreecommitdiff
path: root/alot/widgets
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-13 12:23:27 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-13 12:30:44 +0100
commitd3e1e66d87eccc51bbd28357572553a124ea8d0e (patch)
tree1f0b370e896f2c397e37fc27d8807497d006b397 /alot/widgets
parent0ec02e54b4012e16e00a5dbe180568cb04552b52 (diff)
widgets/thread: sanitize behaviour when crypto part has no content
Diffstat (limited to 'alot/widgets')
-rw-r--r--alot/widgets/thread.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index a165ee45..6c5d71fe 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -124,7 +124,8 @@ class _CryptPartWidget(_MIMEPartWidget):
text_parts.append('crypto processing error: ' + mime_tree.crypt_error)
attr_name = 'crypt_invalid'
- child = _render_mime_tree(mime_tree.children[0], alternative_pref)
+ child = _render_mime_tree(mime_tree.children[0], alternative_pref) \
+ or _EmptyPartWidget()
attr = settings.get_theming_attribute('thread', attr_name)
body_wgt = urwid.AttrMap(urwid.LineBox(child, title = ':'.join(text_parts)), attr)
children = [child]
@@ -314,7 +315,7 @@ class _TextPart(_MIMEPartWidget):
class _EmptyMessageWidget(_MIMEPartWidget):
def __init__(self):
- body_wgt = urwid.Text('<<Message body is empty>>>', align = 'center')
+ body_wgt = urwid.Text('<<< No displayable content >>>', align = 'center')
super().__init__(body_wgt)
def _handle_mixed(mime_tree, alternative_pref):
@@ -478,7 +479,7 @@ class MessageWidget(urwid.WidgetWrap):
self._body_wgt = _render_mime_tree(message.body, alternative_pref)
if self._body_wgt is None:
- self._body_wgt = _EmptyMessageWidget()
+ self._body_wgt = _EmptyPartWidget()
super().__init__(urwid.ListBox(urwid.SimpleListWalker([])))