FIX: checking if status is undefined

This commit is contained in:
Gabriel Rosa
2022-09-09 10:17:22 -03:00
parent 35db24dc59
commit 35172681ce
2 changed files with 9 additions and 8 deletions
+8 -7
View File
@@ -131,13 +131,14 @@ export class PipelinesClientService implements OnModuleInit {
this.pipelineService.getPipelineStatus(data),
)
.then((res) => {
const statusArray = res.status.sort((a, b) => {
if (a.id < b.id) {
return 1;
} else {
return -1;
}
});
const statusArray =
res.status?.sort((a, b) => {
if (a.id < b.id) {
return 1;
} else {
return -1;
}
}) || [];
return { status: statusArray };
})
.catch((err) => {