From 36496a402f10c27e7a5897222f56cc35608e0053 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sun, 27 May 2007 22:23:48 +0000 Subject: [PATCH] Fixed a problem where an empty chat message would cause an uncaught exception. --- src/net/common/clientthread.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/net/common/clientthread.cpp b/src/net/common/clientthread.cpp index 2c465fcd..d95dc221 100644 --- a/src/net/common/clientthread.cpp +++ b/src/net/common/clientthread.cpp @@ -104,9 +104,14 @@ ClientThread::SendChatMessage(const std::string &msg) boost::shared_ptr chat(new NetPacketSendChatText); NetPacketSendChatText::Data chatData; chatData.text = msg; - static_cast(chat.get())->SetData(chatData); - // The sender is thread-safe, so just dump the packet. - GetSender().Send(GetContext().GetSocket(), chat); + try + { + static_cast(chat.get())->SetData(chatData); + // The sender is thread-safe, so just dump the packet. + GetSender().Send(GetContext().GetSocket(), chat); + } catch (const NetException &e) + { + } } ClientCallback &