diff --git a/src/reports/utils/getFamilyIds.ts b/src/reports/utils/getFamilyIds.ts index 1e068a4..92a6859 100644 --- a/src/reports/utils/getFamilyIds.ts +++ b/src/reports/utils/getFamilyIds.ts @@ -21,17 +21,18 @@ const getFilesInfo = async (fileIds: string[], es: Client): Promise const sources = hits.map(hit => hit._source); const filesInfos = []; sources.forEach(source => { - source.participants.forEach(participant => { - if ( - participant.families_id && - !filesInfos.find(f => f.families_id === participant.families_id && f.data_type === source.data_type) - ) { - filesInfos.push({ - data_type: source.data_type, - families_id: participant.families_id || '', - }); - } - }); + source.participants && + source.participants.forEach(participant => { + if ( + participant.families_id && + !filesInfos.find(f => f.families_id === participant.families_id && f.data_type === source.data_type) + ) { + filesInfos.push({ + data_type: source.data_type, + families_id: participant.families_id || '', + }); + } + }); }); return filesInfos; };