fixed the optional chaining

This commit is contained in:
2025-12-02 18:08:39 +05:30
parent 4772c320ba
commit d9f7cd9a0f

View File

@@ -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;