Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Collett <morgan.collett@gmail.com>2008-12-06 14:08:25 (GMT)
committer Morgan Collett <morgan.collett@gmail.com>2008-12-06 14:08:25 (GMT)
commitdd6d59c5caf29aaf71f3c370c234056538059201 (patch)
tree8c05b5e57287f3f6eac1eb816e3bac11cf367543
parent285bce0c9079337275cdffa630f2948198c8a688 (diff)
Fix crash in _add_log when buddy is None and make _add_log more robust
-rw-r--r--pippy_app.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pippy_app.py b/pippy_app.py
index 6ee0a4f..7be5cf2 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -321,6 +321,7 @@ class Chat(ViewSourceActivity):
color_stroke = COLOR_BLACK.get_int()
color_fill = COLOR_WHITE.get_int()
text_color = COLOR_BLACK.get_int()
+ color = '#000000,#FFFFFF'
self._add_log(nick, color, text, status_message)
# Check for Right-To-Left languages:
@@ -457,6 +458,14 @@ class Chat(ViewSourceActivity):
text -- string, body of message
status_message -- boolean
"""
+ if not nick:
+ nick = '???'
+ if not color:
+ color = '#000000,#FFFFFF'
+ if not text:
+ text = '-'
+ if not status_message:
+ status_message = False
self._chat_log += '%s\t%s\t%s\t%d\t%s\n' % (
datetime.strftime(datetime.now(), '%b %d %H:%M:%S'),
nick, color, status_message, text)