Fixed a problem where an empty chat message would cause an uncaught exception.

This commit is contained in:
lotodore
2007-05-27 22:23:48 +00:00
parent 875750a998
commit 36496a402f
+8 -3
View File
@@ -104,9 +104,14 @@ ClientThread::SendChatMessage(const std::string &msg)
boost::shared_ptr<NetPacket> chat(new NetPacketSendChatText);
NetPacketSendChatText::Data chatData;
chatData.text = msg;
static_cast<NetPacketSendChatText *>(chat.get())->SetData(chatData);
// The sender is thread-safe, so just dump the packet.
GetSender().Send(GetContext().GetSocket(), chat);
try
{
static_cast<NetPacketSendChatText *>(chat.get())->SetData(chatData);
// The sender is thread-safe, so just dump the packet.
GetSender().Send(GetContext().GetSocket(), chat);
} catch (const NetException &e)
{
}
}
ClientCallback &