diff options
| author | 2018-12-12 13:54:31 +0000 | |
|---|---|---|
| committer | 2018-12-12 14:43:55 +0000 | |
| commit | 654355c2d114a68639ac36238291ebfceec2537d (patch) | |
| tree | 3339798bf3d774c006ddc4ee7f7aa3c89d782962 /src/channels.cpp | |
| parent | Fix a crash when the core_oper module is not loaded. (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) |
