From 57e9e825f1806233fd9cf6918da41077b875871a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 23 Feb 2022 08:18:06 +0100 Subject: [PATCH] fix: Possible SQL Exception in User Search --- backend/src/graphql/resolver/AdminResolver.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index 0b8e3f52b..cf2374bd1 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -51,6 +51,13 @@ export class AdminResolver { pageSize, ) + if (users.length === 0) { + return { + userCount: 0, + userList: [], + } + } + const creations = await getUserCreations(users.map((u) => u.id)) const adminUsers = await Promise.all(