Skip to content

Commit 1b9f377

Browse files
author
Jean Jordaan
committed
The .replace in getheader would fail for absent headers (that return None).
1 parent 060a776 commit 1b9f377

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

roundup/mailgw.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373
an exception, the original message is bounced back to the sender with the
7474
explanatory message given in the exception.
7575
76-
$Id: mailgw.py,v 1.125 2003-06-24 12:39:20 neaj Exp $
76+
$Id: mailgw.py,v 1.126 2003-06-25 08:02:51 neaj Exp $
7777
'''
7878

7979
import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -186,7 +186,8 @@ def getPart(self):
186186

187187
def getheader(self, name, default=None):
188188
hdr = mimetools.Message.getheader(self, name, default)
189-
hdr = hdr.replace('\n','') # Inserted by rfc822.readheaders
189+
if hdr:
190+
hdr = hdr.replace('\n','') # Inserted by rfc822.readheaders
190191
return rfc2822.decode_header(hdr)
191192

192193
class MailGW:

0 commit comments

Comments
 (0)