diff options
author | js <js-gajim@webkeks.org> | 2008-05-19 21:54:51 +0400 |
---|---|---|
committer | js <js-gajim@webkeks.org> | 2008-05-19 21:54:51 +0400 |
commit | 41fe6ed927daa049929c499d0e2c5acb2121f778 (patch) | |
tree | 304ba72318a243db8c66ffa0bcd598b9ced9581e | |
parent | 1cbe5678da8e453be1437026b1978a5929832503 (diff) |
Better check if msgtxt is not None.
-rw-r--r-- | src/session.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/session.py b/src/session.py index 90afc5276..2726ddd04 100644 --- a/src/session.py +++ b/src/session.py @@ -158,13 +158,14 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession): # 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' |