Add check for undefined object in extractNames

This commit is contained in:
Matteo Gheza 2024-01-12 19:11:48 +01:00
parent 83d0c41c5a
commit 82c8741b6e
1 changed files with 1 additions and 0 deletions

View File

@ -301,6 +301,7 @@ export class TableComponent implements OnInit, OnDestroy {
}
extractNamesFromObject(obj: any) {
if(typeof obj === 'undefined') return "";
return obj.flatMap((e: any) => {
if(e.surname === null) return e.name;
return e.surname+" "+e.name;