Skip to content

Commit 7965980

Browse files
undefined for certificateTemplateUrl
1 parent 20340b4 commit 7965980

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

project/ws/app/src/lib/routes/home/routes/marketplace-provider/components/transformations/transformations.component.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,17 @@ export class TransformationsComponent implements OnInit, OnChanges {
140140
}
141141

142142
getImageName(url: string): string {
143-
const lastSlashIndex = url.lastIndexOf('/')
144-
const imageWithPrefix = url.slice(lastSlashIndex + 1)
145-
const firstUnderscoreIndex = imageWithPrefix.indexOf('_')
146-
if (firstUnderscoreIndex !== -1) {
147-
return imageWithPrefix.slice(firstUnderscoreIndex + 1)
148-
}
143+
if (url) {
144+
const lastSlashIndex = url.lastIndexOf('/')
145+
const imageWithPrefix = url.slice(lastSlashIndex + 1)
146+
const firstUnderscoreIndex = imageWithPrefix.indexOf('_')
147+
if (firstUnderscoreIndex !== -1) {
148+
return imageWithPrefix.slice(firstUnderscoreIndex + 1)
149+
}
149150

150-
return imageWithPrefix
151+
return imageWithPrefix
152+
}
153+
return url
151154
}
152155

153156
ngOnInit(): void {

0 commit comments

Comments
 (0)