summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-12-12 13:54:31 +0000
committerPeter Powell <petpow@saberuk.com>2018-12-12 14:43:55 +0000
commit654355c2d114a68639ac36238291ebfceec2537d (patch)
tree3339798bf3d774c006ddc4ee7f7aa3c89d782962 /src/channels.cpp
parent51891f10f2a05e16e45651a669db6680a433bf9b (diff)
Reject setting modes which are null or not registered.
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index c9816db4b..e25500892 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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)