@@ -79,21 +79,23 @@ export const getWorkflows = (envID: string, appIds: string): Promise<WorkflowsRe
79
79
for ( const _ciConfig of ciConfig . result ) {
80
80
_ciConfigMap . set ( _ciConfig . appId , _ciConfig )
81
81
}
82
- for ( const workflowResult of workflow . result . workflows ) {
83
- const processWorkflowData = processWorkflow (
84
- {
85
- ...workflowResult ,
86
- workflows : [ workflowResult ] ,
87
- } as WorkflowResult ,
88
- _ciConfigMap . get ( workflowResult . appId ) ,
89
- cdConfig . result as CdPipelineResult ,
90
- externalCIConfig . result ,
91
- WorkflowTrigger ,
92
- WorkflowTrigger . workflow ,
93
- filterChildAndSiblingCD ( envID ) ,
94
- )
95
- _workflows . push ( ...processWorkflowData . workflows )
96
- _filteredCIPipelines . set ( workflowResult . appId , processWorkflowData . filteredCIPipelines )
82
+ if ( workflow ?. result ?. workflows ) {
83
+ for ( const workflowResult of workflow . result . workflows ) {
84
+ const processWorkflowData = processWorkflow (
85
+ {
86
+ ...workflowResult ,
87
+ workflows : [ workflowResult ] ,
88
+ } as WorkflowResult ,
89
+ _ciConfigMap . get ( workflowResult . appId ) ,
90
+ cdConfig . result as CdPipelineResult ,
91
+ externalCIConfig . result ,
92
+ WorkflowTrigger ,
93
+ WorkflowTrigger . workflow ,
94
+ filterChildAndSiblingCD ( envID ) ,
95
+ )
96
+ _workflows . push ( ...processWorkflowData . workflows )
97
+ _filteredCIPipelines . set ( workflowResult . appId , processWorkflowData . filteredCIPipelines )
98
+ }
97
99
}
98
100
return { workflows : _workflows , filteredCIPipelines : _filteredCIPipelines }
99
101
} )
0 commit comments