From db10746bec23c724f0e4c07191be7e8793b73724 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 23 Sep 2024 12:24:19 +0700 Subject: [PATCH] UBERF-8224: Fix undefined rejection exception (#6677) Signed-off-by: Andrey Sobolev --- services/github/pod-github/src/platform.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/services/github/pod-github/src/platform.ts b/services/github/pod-github/src/platform.ts index 626f1237fd..57091ea7d4 100644 --- a/services/github/pod-github/src/platform.ts +++ b/services/github/pod-github/src/platform.ts @@ -698,16 +698,16 @@ export class PlatformWorker { errors++ return } + if (workspaceInfo?.workspace === undefined) { + this.ctx.error('No workspace exists for workspaceId', { workspace }) + errors++ + return + } + if (workspaceInfo?.disabled === true) { + this.ctx.error('Workspace is disabled workspaceId', { workspace }) + return + } try { - if (workspaceInfo?.workspace === undefined) { - this.ctx.error('No workspace exists for workspaceId', { workspace }) - errors++ - return - } - if (workspaceInfo?.disabled === true) { - this.ctx.error('Workspace is disabled workspaceId', { workspace }) - return - } const branding = Object.values(this.brandingMap).find((b) => b.key === workspaceInfo?.branding) ?? null const workerCtx = this.ctx.newChild('worker', { workspace: workspaceInfo.workspace }, {})