outposts/ldap: fix panic in type conversion when value is nil

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-04-11 15:52:55 +02:00
parent 677621989a
commit 9b6e47e6b8
2 changed files with 10 additions and 3 deletions

View File

@ -29,7 +29,9 @@ func ldapResolveTypeSingle(in interface{}) *string {
s := BoolToString(*t)
return &s
default:
log.WithField("type", reflect.TypeOf(in).String()).Warning("Type can't be mapped to LDAP yet")
if in != nil {
log.WithField("type", reflect.TypeOf(in).String()).Warning("Type can't be mapped to LDAP yet")
}
return nil
}
}