Skip to content

Commit

Permalink
Merge pull request #52 from fpants/fix/rdnattributes-slice-nilpointer…
Browse files Browse the repository at this point in the history
…dereference

Add RDN attributes only when slice is not nil
  • Loading branch information
l-with authored Nov 1, 2023
2 parents 4b71ea7 + 845de1f commit 1d8037b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ldap/resource_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ func resourceLDAPEntryRead(_ context.Context, d *schema.ResourceData, m interfac
return diag.FromErr(err)
}
ignoreRDNAttributes := client.GetRDNAttributes(ldapEntry, id)
*ignoreAndBase64Encode.IgnoreAttributes = append(*ignoreAndBase64Encode.IgnoreAttributes, *ignoreRDNAttributes...)
if ignoreRDNAttributes != nil {
*ignoreAndBase64Encode.IgnoreAttributes = append(*ignoreAndBase64Encode.IgnoreAttributes, *ignoreRDNAttributes...)
}
client.IgnoreAndBase64encodeAttributes(ldapEntry, ignoreAndBase64Encode)

err = d.Set(attributeNameDn, id)
Expand Down

0 comments on commit 1d8037b

Please sign in to comment.