Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,19 @@ private Contact getContact(Map<String, Object> contactMap) {
Object postalCode = contactMap.get("postalCode");
Object region = contactMap.get("region");
Country country = Country.valueOf((countryCode != null) ? countryCode.toString() : "US");
ArrayList<String> addressLinesList = new ArrayList<>();
if (addressLines instanceof java.util.List) {
for (Object line : (java.util.List<?>) addressLines) {
if (line != null) {
addressLinesList.add(line.toString());
}
}
}

return new Contact.Builder()
.familyName((familyName != null) ? familyName.toString() : "")
.email((email != null) ? email.toString() : "")
.addressLines((addressLines != null) ? (ArrayList<String>) addressLines : new ArrayList<>())
.addressLines(addressLinesList)
.city((city != null) ? city.toString() : "")
.countryCode(country)
.postalCode((postalCode != null) ? postalCode.toString() : "")
Expand Down
Loading