diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2010-01-06 03:47:22 +0100 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-01-06 14:22:40 +0000 |
commit | fa87aa5ae0ca08fc0a2d404e4a12120ddb337931 (patch) | |
tree | 65f651686542426a18b5093754358dc6eac8fab9 /src/net | |
parent | 4424ca5b9dea2a9824b83f3ab691b8c575a35267 (diff) | |
download | mana-client-fa87aa5ae0ca08fc0a2d404e4a12120ddb337931.tar.gz mana-client-fa87aa5ae0ca08fc0a2d404e4a12120ddb337931.tar.bz2 mana-client-fa87aa5ae0ca08fc0a2d404e4a12120ddb337931.tar.xz mana-client-fa87aa5ae0ca08fc0a2d404e4a12120ddb337931.zip |
Prevented a segfault when the client receives a chat message before the GUI is initialized.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/chathandler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |