Skip to content

Commit 82b1085

Browse files
committed
simplify
1 parent d72f4b2 commit 82b1085

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

coderd/users.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ func (api *API) users(rw http.ResponseWriter, r *http.Request) {
257257
userIDs = append(userIDs, user.ID)
258258
}
259259
organizationIDsByMemberIDsRows, err := api.Database.GetOrganizationIDsByMemberIDs(ctx, userIDs)
260-
if xerrors.Is(err, sql.ErrNoRows) {
261-
err = nil
262-
}
263-
if err != nil {
260+
// No rows is fine, you just requested an empty page.
261+
if !xerrors.Is(err, sql.ErrNoRows) {
264262
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
265263
Message: "Internal error fetching user's organizations.",
266264
Detail: err.Error(),

0 commit comments

Comments
 (0)