summaryrefslogtreecommitdiff
path: root/include
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 /include
parent51891f10f2a05e16e45651a669db6680a433bf9b (diff)
Reject setting modes which are null or not registered.
Diffstat (limited to 'include')
-rw-r--r--include/users.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/users.h b/include/users.h
index 28b370725..ef19adb5d 100644
--- a/include/users.h
+++ b/include/users.h
@@ -932,5 +932,6 @@ inline bool User::IsModeSet(UserModeReference& moderef) const
inline void User::SetMode(ModeHandler* mh, bool value)
{
- modes[mh->GetId()] = value;
+ if (mh && mh->GetId() != ModeParser::MODEID_MAX)
+ modes[mh->GetId()] = value;
}