From fda41360dcb7e68c8e3003c73fdb98db2514bf5f Mon Sep 17 00:00:00 2001 From: vasraz Date: Fri, 18 Aug 2023 19:40:44 +0100 Subject: Fix 'Fail to import service with CP'-bug Signed-off-by: Vasyl Razinkov Change-Id: I7261b03eb7e796aaa66ac3dbd0116bc62d2d6e71 Issue-ID: SDC-4599 --- catalog-ui/src/app/utils/service-csar-reader.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'catalog-ui') diff --git a/catalog-ui/src/app/utils/service-csar-reader.ts b/catalog-ui/src/app/utils/service-csar-reader.ts index 20dfe6ca6b..4c9b0cd0ca 100644 --- a/catalog-ui/src/app/utils/service-csar-reader.ts +++ b/catalog-ui/src/app/utils/service-csar-reader.ts @@ -82,7 +82,10 @@ export class ServiceCsarReader { } private readSubstitutionNodeFromMainTemplateFile(entryDefinitionFileContent) { - this.serviceCsar.substitutionNodeType = load(entryDefinitionFileContent).topology_template.substitution_mappings.node_type; + const loadEntryDefinitionFileContent = load(entryDefinitionFileContent); + if (loadEntryDefinitionFileContent.topology_template && loadEntryDefinitionFileContent.topology_template.substitution_mappings) { + this.serviceCsar.substitutionNodeType = loadEntryDefinitionFileContent.topology_template.substitution_mappings.node_type; + } } private setMetadata = (metadata:object) : void => { @@ -147,4 +150,4 @@ export class ServiceCsarReader { }); this.serviceCsar.extraServiceMetadata = extraServiceMetadata; } -} \ No newline at end of file +} -- cgit 1.2.3-korg