aboutsummaryrefslogtreecommitdiff
path: root/write.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-13 13:53:35 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-13 14:41:49 +0100
commit6f893138a3b593e6918c3dc1bd04d12f01d6c4a5 (patch)
tree0ce0200994f10e216a4d05251fe1074837f2d66d /write.go
parent851573e28f73102dedc6b9aca04f5f3248bdc9f4 (diff)
downloadbottin-6f893138a3b593e6918c3dc1bd04d12f01d6c4a5.tar.gz
bottin-6f893138a3b593e6918c3dc1bd04d12f01d6c4a5.zip
Make getAttribute return an empty array instead of nil when key not found
Diffstat (limited to 'write.go')
-rw-r--r--write.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/write.go b/write.go
index 2c35309..57c642c 100644
--- a/write.go
+++ b/write.go
@@ -118,9 +118,6 @@ func (server *Server) handleAddInternal(state *State, r *message.AddRequest) (in
server.logger.Warnf("Could not add %s to memberOf of %s: %s", dn, member, err)
continue
}
- if memberGroups == nil {
- memberGroups = []string{}
- }
alreadyMember := false
for _, mb := range memberGroups {
@@ -473,9 +470,6 @@ func (server *Server) handleModifyInternal(state *State, r *message.ModifyReques
server.logger.Warnf("Could not add %s to memberOf of %s: %s", dn, addMem, err)
continue
}
- if memberOf == nil {
- memberOf = []string{}
- }
alreadyMember := false
for _, mb := range memberOf {
@@ -501,9 +495,6 @@ func (server *Server) handleModifyInternal(state *State, r *message.ModifyReques
server.logger.Warnf("Could not remove %s from memberOf of %s: %s", dn, delMem, err)
continue
}
- if memberOf == nil {
- memberOf = []string{}
- }
newMemberOf := []string{}
for _, g := range memberOf {
if g != dn {