From 3f2c4a6645f7776deb1d05e67412b13ca40e2710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 9 May 2022 12:59:32 +0200 Subject: [PATCH] :bug: Fix check when `globalRole` is `undefined` --- packages/cli/src/CredentialsHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/CredentialsHelper.ts b/packages/cli/src/CredentialsHelper.ts index 99c92a5bc7..e9c8fb4623 100644 --- a/packages/cli/src/CredentialsHelper.ts +++ b/packages/cli/src/CredentialsHelper.ts @@ -757,7 +757,7 @@ export function whereClause({ }): WhereClause { const where: WhereClause = entityId ? { [entityType]: { id: entityId } } : {}; - if (user.globalRole.name !== 'owner') { + if (user?.globalRole?.name !== 'owner') { where.user = { id: user.id }; }