Skip to content

Commit

Permalink
Fix nil pointer exception when resolving members of a group (rest dri…
Browse files Browse the repository at this point in the history
…ver) (#2265)
  • Loading branch information
gmgigi96 authored Nov 11, 2021
1 parent a6eb9d5 commit 9da0f15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/unreleased/fix-nil-exception-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: Fix nil pointer exception when resolving members of a group (rest driver)

https://github.com/cs3org/reva/pull/2265
4 changes: 3 additions & 1 deletion pkg/cbox/group/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ func (m *manager) GetMembers(ctx context.Context, gid *grouppb.GroupId) ([]*user
if !ok {
return nil, errors.New("rest: error in type assertion")
}
users = append(users, &userpb.UserId{OpaqueId: userInfo["upn"].(string), Idp: m.conf.IDProvider})
if id, ok := userInfo["upn"].(string); ok {
users = append(users, &userpb.UserId{OpaqueId: id, Idp: m.conf.IDProvider})
}
}

if err = m.cacheGroupMembers(gid, users); err != nil {
Expand Down

0 comments on commit 9da0f15

Please sign in to comment.