Skip to content

Commit 5825209

Browse files
committed
fix undefined contacts info
1 parent dabd3a2 commit 5825209

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/client/src/pages/DataView360/components/ContactInfo.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ class ContactInfo extends Component {
2323

2424

2525
populate_participant_with_data_source(participant, participantData) {
26-
if (participant) {
27-
return {
28-
first_name: participantData.first_name || participant.first_name,
29-
last_name: participantData.last_name || participant.last_name,
30-
email: participantData.email || participant.email,
31-
mobile: participantData.mobile || participant.mobile,
32-
city: participantData.city || participant.city,
33-
street_and_number: participantData.street_and_number || participant.street_and_number
34-
};
35-
}
26+
return {
27+
first_name: _.get(participantData, "first_name") || _.get(participant, "first_name"),
28+
last_name: _.get(participantData, "last_name") || _.get(participant, "last_name"),
29+
email: _.get(participantData, "email") || _.get(participant, "email"),
30+
mobile: _.get(participantData, "mobile") || _.get(participant, "mobile"),
31+
city: _.get(participantData, "city") || _.get(participant, "city"),
32+
street_and_number: _.get(participantData, "street_and_number") || _.get(participant, "street_and_number")
33+
};
3634
}
3735

3836
//populates by the order of the source types array
@@ -81,8 +79,7 @@ class ContactInfo extends Component {
8179
</div>
8280
</Paper>
8381
</Container>
84-
)
85-
;
82+
);
8683
}
8784
}
8885

0 commit comments

Comments
 (0)