From 0751f52f3711819adae1354c7ea5e16e16e4d0fa Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Tue, 22 May 2018 04:23:33 -0400 Subject: [PATCH] fix #268 --- irc/modes/modes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/irc/modes/modes.go b/irc/modes/modes.go index 287dbd44..19328457 100644 --- a/irc/modes/modes.go +++ b/irc/modes/modes.go @@ -340,6 +340,10 @@ func NewModeSet() *ModeSet { // test whether `mode` is set func (set *ModeSet) HasMode(mode Mode) bool { + if set == nil { + return false + } + set.RLock() defer set.RUnlock() return set.modes[mode]