[hack] don't traceback when there's no network connection

This commit is contained in:
Dan Williams 2006-06-22 12:52:51 -04:00
parent 89d40971fe
commit 2351ee0458

View File

@ -216,16 +216,20 @@ class Chat(gtk.VBox):
def send_sketch(self, svgdata): def send_sketch(self, svgdata):
if not svgdata or not len(svgdata): if not svgdata or not len(svgdata):
return return
if self._stream_writer:
self._stream_writer.write(self.serialize_message(svgdata)) self._stream_writer.write(self.serialize_message(svgdata))
owner = PresenceService.get_instance().get_owner() owner = PresenceService.get_instance().get_owner()
if owner:
self._insert_sketch(owner, svgdata) self._insert_sketch(owner, svgdata)
def send_text_message(self, text): def send_text_message(self, text):
"""Send a chat message and insert it into the local buffer.""" """Send a chat message and insert it into the local buffer."""
if len(text) <= 0: if len(text) <= 0:
return return
if self._stream_writer:
self._stream_writer.write(self.serialize_message(text)) self._stream_writer.write(self.serialize_message(text))
owner = PresenceService.get_instance().get_owner() owner = PresenceService.get_instance().get_owner()
if owner:
self._insert_rich_message(owner, text) self._insert_rich_message(owner, text)
def serialize_message(self, message): def serialize_message(self, message):