Skip to content

Commit de192d0

Browse files
msivasubramaniaanvrubezhny
authored andcommitted
Added null check
1 parent afeabc0 commit de192d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/explorer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,11 @@ export class OpenShiftExplorer implements TreeDataProvider<ExplorerItem>, Dispos
697697
const namespace: string = await Oc.Instance.getActiveProject();
698698
const collections: OtherObject[] = await Oc.Instance.getKubernetesObjects(element.kind, namespace, undefined, this.executionContext);
699699
const taskNames: PipelineTasks[] = [];
700+
if (!collections || collections.length === 0 || !collections[0].spec) {
701+
return [];
702+
}
700703
const tasks = collections[0].spec.tasks;
701-
tasks.map((task) => {
704+
tasks?.map((task) => {
702705
taskNames.push({ name : task.name, context: 'pipelineTask' });
703706
})
704707
return taskNames;

0 commit comments

Comments
 (0)