]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Reject setting modes which are null or not registered.
[user/henk/code/inspircd.git] / src / channels.cpp
index c9816db4b006795fc0dde9faef88ade67a6d07b7..e25500892baa8c8f3942884f183e329fc44e29e1 100644 (file)
@@ -40,7 +40,8 @@ Channel::Channel(const std::string &cname, time_t ts)
 
 void Channel::SetMode(ModeHandler* mh, bool on)
 {
-       modes[mh->GetId()] = on;
+       if (mh && mh->GetId() != ModeParser::MODEID_MAX)
+               modes[mh->GetId()] = on;
 }
 
 void Channel::SetTopic(User* u, const std::string& ntopic, time_t topicts, const std::string* setter)