# HG changeset patch # User Sylvain Thénault # Date 1274781376 -7200 # Node ID 297b2002a0830c9610eb5aa4873da14d06604ebd # Parent 4e3ca117c275dde4128dcf0ca0084a1c1fa93910 fix 978144: exception with view send-email if empty subject diff -r 4e3ca117c275 -r 297b2002a083 mail.py --- a/mail.py Tue May 25 10:55:57 2010 +0200 +++ b/mail.py Tue May 25 11:56:16 2010 +0200 @@ -85,8 +85,11 @@ assert type(content) is unicode, repr(content) msg = MIMEText(content.encode('UTF-8'), 'plain', 'UTF-8') # safety: keep only the first newline - subject = subject.splitlines()[0] - msg['Subject'] = header(subject) + try: + subject = subject.splitlines()[0] + msg['Subject'] = header(subject) + except IndexError: + pass # no subject if uinfo.get('email'): email = uinfo['email'] elif config and config['sender-addr']: