Fix exception while loading VF "General" page 39/129339/2
authorandre.schmid <andre.schmid@est.tech>
Fri, 20 May 2022 18:14:00 +0000 (19:14 +0100)
committerMichael Morris <michael.morris@est.tech>
Mon, 23 May 2022 10:49:14 +0000 (10:49 +0000)
The exception is thrown when accessing a VF General page from a VF
that is not associated to a CSAR file (Imported from CSAR file).
The code is trying to access the CSAR file that does not exist.

Change-Id: I0df34e75911e4a912f50ff8993637952e32d48c6
Issue-ID: SDC-4013
Signed-off-by: andre.schmid <andre.schmid@est.tech>
catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts

index 043f4dd..6b0d490 100644 (file)
@@ -216,7 +216,9 @@ export class GeneralViewModel {
                 if(this.$stateParams.componentCsar && this.$scope.component.lifecycleState === 'NOT_CERTIFIED_CHECKIN' && !this.$scope.isCreateMode()) {
                     this.$scope.importedToscaBrowseFileText = this.$scope.originComponent.name + ' (' + (this.$scope.originComponent as Resource).csarVersion + ')';
                 } else {
-                    this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[csarUUID][csarVersion];
+                    if (onboardCsarFilesMap && onboardCsarFilesMap[csarUUID]) {
+                        this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[csarUUID][csarVersion];
+                    }
                 }
             }
         }