UBERF-8224: Fix undefined rejection exception (#6677)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-09-23 12:24:19 +07:00 committed by GitHub
parent 1e0edd4eb5
commit db10746bec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -698,7 +698,6 @@ export class PlatformWorker {
errors++ errors++
return return
} }
try {
if (workspaceInfo?.workspace === undefined) { if (workspaceInfo?.workspace === undefined) {
this.ctx.error('No workspace exists for workspaceId', { workspace }) this.ctx.error('No workspace exists for workspaceId', { workspace })
errors++ errors++
@ -708,6 +707,7 @@ export class PlatformWorker {
this.ctx.error('Workspace is disabled workspaceId', { workspace }) this.ctx.error('Workspace is disabled workspaceId', { workspace })
return return
} }
try {
const branding = Object.values(this.brandingMap).find((b) => b.key === workspaceInfo?.branding) ?? null const branding = Object.values(this.brandingMap).find((b) => b.key === workspaceInfo?.branding) ?? null
const workerCtx = this.ctx.newChild('worker', { workspace: workspaceInfo.workspace }, {}) const workerCtx = this.ctx.newChild('worker', { workspace: workspaceInfo.workspace }, {})