light modification

This commit is contained in:
mr
2025-01-23 09:27:27 +01:00
parent f8ac3154e1
commit 8cba10c4fe
2 changed files with 4 additions and 2 deletions

View File

@@ -68,7 +68,8 @@ func (a *collaborativeAreaMongoAccessor) StoreOne(data utils.DBObject) (utils.DB
data.(*CollaborativeArea).Clear(id) // set the creator
// retrieve or proper peer
dd, code, err := a.peerAccessor.Search(nil, "0", true)
if code != 200 || len(dd) == 0 {
if code != 200 || dd == nil || len(dd) == 0 {
return nil, code, errors.New("Could not retrieve the peer" + err.Error())
}
data.(*CollaborativeArea).CollaborativeAreaRule.Creator = dd[0].GetID()