summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/manaserv/chathandler.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp
index 6c97fae3..efb156f0 100644
--- a/src/net/manaserv/chathandler.cpp
+++ b/src/net/manaserv/chathandler.cpp
@@ -255,7 +255,17 @@ void ChatHandler::handleChatMessage(Net::MessageIn &msg)
std::string chatMsg = msg.readString();
Channel *channel = channelManager->findById(channelId);
- channel->getTab()->chatLog(userNick, chatMsg);
+ if (channel)
+ {
+ ChannelTab *tab = channel->getTab();
+ if (tab)
+ tab->chatLog(userNick, chatMsg);
+ }
+ else
+ {
+ // Can't find channel
+ logger->log("Couldn't find chat channel id: %hi", channelId);
+ }
}
void ChatHandler::handleQuitChannelResponse(Net::MessageIn &msg)