From 796598044220fbf47738ce3878d06ce6e7e9292d Mon Sep 17 00:00:00 2001 From: mansurskTarento Date: Mon, 3 Mar 2025 17:56:57 +0530 Subject: [PATCH] undefined for certificateTemplateUrl --- .../transformations.component.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts index 406aaf9b..4e5ec463 100644 --- a/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts @@ -140,14 +140,17 @@ export class TransformationsComponent implements OnInit, OnChanges { } getImageName(url: string): string { - const lastSlashIndex = url.lastIndexOf('/') - const imageWithPrefix = url.slice(lastSlashIndex + 1) - const firstUnderscoreIndex = imageWithPrefix.indexOf('_') - if (firstUnderscoreIndex !== -1) { - return imageWithPrefix.slice(firstUnderscoreIndex + 1) - } + if (url) { + const lastSlashIndex = url.lastIndexOf('/') + const imageWithPrefix = url.slice(lastSlashIndex + 1) + const firstUnderscoreIndex = imageWithPrefix.indexOf('_') + if (firstUnderscoreIndex !== -1) { + return imageWithPrefix.slice(firstUnderscoreIndex + 1) + } - return imageWithPrefix + return imageWithPrefix + } + return url } ngOnInit(): void {