diff --git a/state/channel.go b/state/channel.go index 17b0580..e45b6c8 100644 --- a/state/channel.go +++ b/state/channel.go @@ -299,6 +299,9 @@ func (ch *channel) String() string { // Returns a string representing the channel modes. Looks like: // +npk key func (cm *ChanMode) String() string { + if cm == nil { + return "No modes set" + } str := "+" a := make([]string, 0) v := reflect.Indirect(reflect.ValueOf(cm)) @@ -335,6 +338,9 @@ func (cm *ChanMode) String() string { // Returns a string representing the channel privileges. Looks like: // +o func (cp *ChanPrivs) String() string { + if cp == nil { + return "No modes set" + } str := "+" v := reflect.Indirect(reflect.ValueOf(cp)) t := v.Type() diff --git a/state/nick.go b/state/nick.go index ecd52c4..b29d98a 100644 --- a/state/nick.go +++ b/state/nick.go @@ -183,6 +183,9 @@ func (nk *nick) String() string { // Returns a string representing the nick modes. Looks like: // +iwx func (nm *NickMode) String() string { + if nm == nil { + return "No modes set" + } str := "+" v := reflect.Indirect(reflect.ValueOf(nm)) t := v.Type()