summaryrefslogtreecommitdiff
path: root/alot/addressbooks.py
diff options
context:
space:
mode:
authorJohann Weging <johann@weging.net>2012-11-10 17:35:52 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-11-10 17:04:45 +0000
commitbb495aa6827e0501ea4710aa4ed037772d89b7e1 (patch)
tree2bc18ba9d966490d61448c9709dca0d33ee77f65 /alot/addressbooks.py
parent33e32acfa6e82de23ccf718f6cad169a24fb6419 (diff)
Made the abook regexp matching more robust.
Diffstat (limited to 'alot/addressbooks.py')
-rw-r--r--alot/addressbooks.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/addressbooks.py b/alot/addressbooks.py
index d3f64b6c..59f093de 100644
--- a/alot/addressbooks.py
+++ b/alot/addressbooks.py
@@ -97,7 +97,8 @@ class MatchSdtoutAddressbook(AddressBook):
m = re.match(self.match, l, self.reflags)
if m:
info = m.groupdict()
- email = info['email'].strip()
- name = info['name']
- res.append((name, email))
+ if 'email' and 'name' in info:
+ email = info['email'].strip()
+ name = info['name']
+ res.append((name, email))
return res