diff options
author | Johann Weging <johann@weging.net> | 2012-11-10 17:35:52 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-11-10 17:04:45 +0000 |
commit | bb495aa6827e0501ea4710aa4ed037772d89b7e1 (patch) | |
tree | 2bc18ba9d966490d61448c9709dca0d33ee77f65 /alot/addressbooks.py | |
parent | 33e32acfa6e82de23ccf718f6cad169a24fb6419 (diff) |
Made the abook regexp matching more robust.
Diffstat (limited to 'alot/addressbooks.py')
-rw-r--r-- | alot/addressbooks.py | 7 |
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 |