diff --git a/lambda/index.js b/lambda/index.js index 9b46017..970e66c 100644 --- a/lambda/index.js +++ b/lambda/index.js @@ -148,9 +148,7 @@ function extractUserFields(googleUser) { if (googleUser.phones && googleUser.phones.length > 0) { const workPhone = googleUser.phones.find((p) => p.type === "work" && p.value); const primaryPhone = googleUser.phones.find((p) => p.primary && p.value) || googleUser.phones.find((p) => p.value); - phone = (workPhone || primaryPhone || {}).value || ""; - } - + phone = (workPhone && workPhone.value) || primaryPhone.value || ""; return { email, jobTitle, phone }; }