From d9f7cd9a0fcf5c91f1f9577fe4e00da6c42c21a0 Mon Sep 17 00:00:00 2001 From: Mayank Mishra Date: Tue, 2 Dec 2025 18:08:39 +0530 Subject: [PATCH] fixed the optional chaining --- src/modules/host/services/host.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/host/services/host.service.ts b/src/modules/host/services/host.service.ts index d97d0f9..0794b04 100644 --- a/src/modules/host/services/host.service.ts +++ b/src/modules/host/services/host.service.ts @@ -172,7 +172,7 @@ export class HostService { } } } - if (host.user.profileImage) { + if (host.user?.profileImage) { const key = host.user.profileImage.startsWith("http") ? host.user.profileImage.split(".com/")[1] : host.user.profileImage; @@ -180,7 +180,7 @@ export class HostService { host.user.profileImage = await getPresignedUrl(bucket, key); } - if (host.logoPath) { + if (host?.logoPath) { const key = host.logoPath.startsWith('http') ? host.logoPath.split('.com/')[1] : host.logoPath; @@ -188,7 +188,7 @@ export class HostService { host.logoPath = await getPresignedUrl(bucket, key); } - if (host.accountManager.profileImage) { + if (host.accountManager?.profileImage) { const key = host.accountManager.profileImage.startsWith('http') ? host.accountManager.profileImage.split('.com/')[1] : host.accountManager.profileImage;