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);
|
boost::shared_ptr<NetPacket> chat(new NetPacketSendChatText);
|
||||||
NetPacketSendChatText::Data chatData;
|
NetPacketSendChatText::Data chatData;
|
||||||
chatData.text = msg;
|
chatData.text = msg;
|
||||||
|
try
|
||||||
|
{
|
||||||
static_cast<NetPacketSendChatText *>(chat.get())->SetData(chatData);
|
static_cast<NetPacketSendChatText *>(chat.get())->SetData(chatData);
|
||||||
// The sender is thread-safe, so just dump the packet.
|
// The sender is thread-safe, so just dump the packet.
|
||||||
GetSender().Send(GetContext().GetSocket(), chat);
|
GetSender().Send(GetContext().GetSocket(), chat);
|
||||||
|
} catch (const NetException &e)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientCallback &
|
ClientCallback &
|
||||||
|
|||||||
Reference in New Issue
Block a user