summaryrefslogtreecommitdiff
path: root/alot/buffers.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-03-06 20:49:52 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-03-06 20:49:52 +0000
commitd8cf1e91505275834d0e67c3a2607bc543e16a64 (patch)
tree3fa1344874db4c5249ad5b81d816166eb033b589 /alot/buffers.py
parent4da4496faa9a16e0fa74dbe0e30eb6a4199465a9 (diff)
fix issue with empty headers list in envelope
buffer: before, once you removed the last entry in an envelopes headers list the buffer tried to display an empty listbox, which fails. This commit makes the buffer only add that list if it isn't empty
Diffstat (limited to 'alot/buffers.py')
-rw-r--r--alot/buffers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 93a1afb9..9bb247f2 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -116,8 +116,10 @@ class EnvelopeBuffer(Buffer):
for value in vlist:
lines.append((k, value))
- self.header_wgt = widgets.HeadersList(lines)
- displayed_widgets.append(self.header_wgt)
+ # add header list widget iff header values exists
+ if lines:
+ self.header_wgt = widgets.HeadersList(lines)
+ displayed_widgets.append(self.header_wgt)
#display attachments
lines = []