summaryrefslogtreecommitdiff
path: root/alot/buffers.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-14 21:12:24 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-14 21:46:04 +0000
commit6856275a70eaa2c8e9311d871080ee34d2863219 (patch)
tree2be1504abc1e99fa263d2b2751e1b0e7e11fd89c /alot/buffers.py
parentb5747bfc7c42fd861565f4e6508c4d5b4c50b22d (diff)
fix: focussing of empty pile
if no attachments are in the envelope, don't add an empty pile to the EnvelopeBuffer. If this gets focussed, urwid dies. issue #150
Diffstat (limited to 'alot/buffers.py')
-rw-r--r--alot/buffers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 0cb77805..09db8246 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -113,8 +113,9 @@ class EnvelopeBuffer(Buffer):
lines = []
for a in self.envelope.attachments:
lines.append(widgets.AttachmentWidget(a, selectable=False))
- self.attachment_wgt = urwid.Pile(lines)
- displayed_widgets.append(self.attachment_wgt)
+ if lines:
+ self.attachment_wgt = urwid.Pile(lines)
+ displayed_widgets.append(self.attachment_wgt)
#self.body_wgt = widgets.MessageBodyWidget(self.mail)
self.body_wgt = urwid.Text(self.envelope.body)