This commit is contained in:
Dale Campbell 2018-09-06 21:19:33 +00:00 committed by GitHub
commit e13696545a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -188,13 +188,15 @@ func (nm *NickMode) String() string {
}
str := "+"
v := reflect.Indirect(reflect.ValueOf(nm))
t := v.Type()
for i := 0; i < v.NumField(); i++ {
switch f := v.Field(i); f.Kind() {
// only bools here at the mo!
case reflect.Bool:
if f.Bool() {
str += NickModeToString[t.Field(i).Name]
if v.IsValid() {
t := v.Type()
for i := 0; i < v.NumField(); i++ {
switch f := v.Field(i); f.Kind() {
// only bools here at the mo!
case reflect.Bool:
if f.Bool() {
str += NickModeToString[t.Field(i).Name]
}
}
}
}