mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-12 03:18:08 -04:00
guard against possible empty groups
This commit is contained in:
@@ -28,8 +28,10 @@ func (o Ocs) ListUserGroups(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// short circuit if there is a user already in the context
|
||||
if u, ok := user.ContextGetUser(r.Context()); ok {
|
||||
mustNotFail(render.Render(w, r, response.DataRender(&data.Groups{Groups: u.Groups})))
|
||||
return
|
||||
if len(u.Groups) > 0 {
|
||||
mustNotFail(render.Render(w, r, response.DataRender(&data.Groups{Groups: u.Groups})))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if isValidUUID(userid) {
|
||||
|
||||
Reference in New Issue
Block a user