Author: js Date: 2008-05-19 19:54:51 +0200 (Mon, 19 May 2008) New Revision: 9670
Modified: trunk/src/session.py Log: Better check if msgtxt is not None.
Modified: trunk/src/session.py =================================================================== --- trunk/src/session.py 2008-05-19 17:41:51 UTC (rev 9669) +++ trunk/src/session.py 2008-05-19 17:54:51 UTC (rev 9670) @@ -158,13 +158,14 @@ # We're also here if we just don't support OTR. # Thus, we should strip the tags from plaintext # messages since they look ugly. - msgtxt = msgtxt.replace('\x20\x09\x20\x20\x09' \ - '\x09\x09\x09\x20\x09\x20\x09\x20\x09' \ - '\x20\x20', '') - msgtxt = msgtxt.replace('\x20\x09\x20\x09\x20' \ - '\x20\x09\x20', '') - msgtxt = msgtxt.replace('\x20\x20\x09\x09\x20' \ - '\x20\x09\x20', '') + if msgtxt: + msgtxt = msgtxt.replace('\x20\x09\x20' \ + '\x20\x09\x09\x09\x09\x20\x09' \ + '\x20\x09\x20\x09\x20\x20', '') + msgtxt = msgtxt.replace('\x20\x09\x20' \ + '\x09\x20\x20\x09\x20', '') + msgtxt = msgtxt.replace('\x20\x20\x09' \ + '\x09\x20\x20\x09\x20', '') else: log_type = 'single_msg_recv'