From aab2d170a1758d9b4acbe4521845218d79ec08c0 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 22 Mar 2022 09:23:21 +0100 Subject: [PATCH] Fix error handling in GetUsers A missing return statement caused GetUsers to return missleading results when the identity backend returned an error. --- changelog/unreleased/graph-getusers-err.md | 6 ++++++ graph/pkg/service/v0/users.go | 1 + 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/graph-getusers-err.md diff --git a/changelog/unreleased/graph-getusers-err.md b/changelog/unreleased/graph-getusers-err.md new file mode 100644 index 00000000000..a9ad69b2cd7 --- /dev/null +++ b/changelog/unreleased/graph-getusers-err.md @@ -0,0 +1,6 @@ +Bugfix: Fix error handling in GraphAPI GetUsers call + +A missing return statement caused GetUsers to return missleading results when +the identity backend returned an error. + +https://github.com/owncloud/ocis/pull/3357 diff --git a/graph/pkg/service/v0/users.go b/graph/pkg/service/v0/users.go index db32655b92b..ab7f3f9ecb9 100644 --- a/graph/pkg/service/v0/users.go +++ b/graph/pkg/service/v0/users.go @@ -46,6 +46,7 @@ func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request) { } else { errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error()) } + return } render.Status(r, http.StatusOK) render.JSON(w, r, &listResponse{Value: users})