diff options
author | Peter Powell <petpow@saberuk.com> | 2018-12-12 13:54:31 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-12-12 14:43:55 +0000 |
commit | 654355c2d114a68639ac36238291ebfceec2537d (patch) | |
tree | 3339798bf3d774c006ddc4ee7f7aa3c89d782962 /src/channels.cpp | |
parent | 51891f10f2a05e16e45651a669db6680a433bf9b (diff) |
Reject setting modes which are null or not registered.
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 3 |
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) |