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;