1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-07-01 02:53:53 +00:00

Fix panic when String is called on nil mode pointers. Fixes #98.

This commit is contained in:
Alex Bramley 2018-09-06 22:23:59 +01:00
parent 47162eb0b8
commit 08c1bcf174
2 changed files with 9 additions and 0 deletions

View file

@ -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()