Fixed a problem where an empty chat message would cause an uncaught exception.
This commit is contained in:
@@ -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 &
|
||||
|
||||
Reference in New Issue
Block a user