Skip to content

Commit 227e26b

Browse files
committed
[Enhancement] Handle empty case for phoneNumbers and emails
1 parent 98c30bd commit 227e26b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/aircall/actions/create-contact/create-contact.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default {
2525
},
2626
},
2727
async run({ $ }) {
28-
const refinedPhoneNumbers = this.phoneNumbers.map((item) => {
28+
const refinedPhoneNumbers = (this.phoneNumbers || []).map((item) => {
2929
if (typeof item === "object" && item !== null) {
3030
return item;
3131
}
@@ -35,7 +35,7 @@ export default {
3535
value: item,
3636
};
3737
});
38-
const refinedEmails = this.emails.map((item) => {
38+
const refinedEmails = (this.emails || []).map((item) => {
3939
if (typeof item === "object" && item !== null) {
4040
return item;
4141
}

0 commit comments

Comments
 (0)