outposts/ldap: fix potential panic when converting attributes
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
3c256fecc6
commit
c2f3ce11b0
|
@ -39,6 +39,9 @@ func ldapResolveTypeSingle(in interface{}) *string {
|
||||||
|
|
||||||
func AKAttrsToLDAP(attrs interface{}) []*ldap.EntryAttribute {
|
func AKAttrsToLDAP(attrs interface{}) []*ldap.EntryAttribute {
|
||||||
attrList := []*ldap.EntryAttribute{}
|
attrList := []*ldap.EntryAttribute{}
|
||||||
|
if attrs == nil {
|
||||||
|
return attrList
|
||||||
|
}
|
||||||
a := attrs.(*map[string]interface{})
|
a := attrs.(*map[string]interface{})
|
||||||
for attrKey, attrValue := range *a {
|
for attrKey, attrValue := range *a {
|
||||||
entry := &ldap.EntryAttribute{Name: attrKey}
|
entry := &ldap.EntryAttribute{Name: attrKey}
|
||||||
|
|
Reference in New Issue