From fa87aa5ae0ca08fc0a2d404e4a12120ddb337931 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Wed, 6 Jan 2010 03:47:22 +0100 Subject: Prevented a segfault when the client receives a chat message before the GUI is initialized. --- src/net/ea/chathandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/net') diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index b3104e36..dd4d18a1 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -60,6 +60,8 @@ ChatHandler::ChatHandler() void ChatHandler::handleMessage(Net::MessageIn &msg) { + if (!localChatTab) return; + Being *being; std::string chatMsg; std::string nick; @@ -147,7 +149,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) if (msg.getId() == SMSG_PLAYER_CHAT) { - if (localChatTab) localChatTab->chatLog(chatMsg, BY_PLAYER); + localChatTab->chatLog(chatMsg, BY_PLAYER); if (pos != std::string::npos) chatMsg.erase(0, pos + 3); -- cgit v1.2.3-70-g09d2