summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-01 17:13:32 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-01 17:13:32 +0000
commitfabc9567b86e5e6a9b7b463f47869fc13e7ae33b (patch)
treeae16d0ff935b55532ccb4b33ef5ec038475d4f30 /src/gui/chat.cpp
parentc95ad0a99169868a2c3169999f0498b8de391a12 (diff)
downloadmana-fabc9567b86e5e6a9b7b463f47869fc13e7ae33b.tar.gz
mana-fabc9567b86e5e6a9b7b463f47869fc13e7ae33b.tar.bz2
mana-fabc9567b86e5e6a9b7b463f47869fc13e7ae33b.tar.xz
mana-fabc9567b86e5e6a9b7b463f47869fc13e7ae33b.zip
Fixed up chat and guilds
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index e9bed822..d2ec0ec9 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -286,8 +286,12 @@ void ChatWindow::chatSend(std::string const &nick, std::string const &msg,
}
else
{
- int channelId = channelManager->findByName(channelName)->getId();
- Net::ChatServer::chat(channelId, msg);
+ Channel *channel = channelManager->findByName(channelName);
+ if (channel)
+ {
+ int channelId = channel->getId();
+ Net::ChatServer::chat(channelId, msg);
+ }
}
return;
}
@@ -497,8 +501,12 @@ ChatWindow::enterChannel(std::string channel, std::string password)
void
ChatWindow::sendToChannel(short channelId, std::string user, std::string msg)
{
- std::string channelName = channelManager->findById(channelId)->getName();
- chatLog(user + ": " + msg, user == player_node->getName() ? BY_PLAYER : BY_OTHER, channelName);
+ Channel *channel = channelManager->findById(channelId);
+ if (channel)
+ {
+ std::string channelName = channel->getName();
+ chatLog(user + ": " + msg, user == player_node->getName() ? BY_PLAYER : BY_OTHER, channelName);
+ }
}
void