Skip to content

Commit

Permalink
bug when visiting activity doesn't have a people link
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgirard committed Mar 15, 2017
1 parent 9293c8a commit 067c5cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/export/annex4.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ const TABS = [
);
})
.map(activity => {
const person = activity.people.find(p => p.role === 'visiting').people;
let person = activity.people.find(p => p.role === 'visiting')
if (person)
person = person.people;
else
return undefined;

let origin = activity.organizations.find(org => org.role === 'orgadorigine');

Expand All @@ -504,7 +508,8 @@ const TABS = [
info.country = COUNTRIES_INDEX[origin.countries[0]].countryLabel.fr;

return info;
});
})
.filter(p => p);

return TEMPLATES.tab5({
id,
Expand Down

0 comments on commit 067c5cb

Please sign in to comment.