diff --git a/helpers/sendinblue.helper.js b/helpers/sendinblue.helper.js index a93f35b..64b74a3 100644 --- a/helpers/sendinblue.helper.js +++ b/helpers/sendinblue.helper.js @@ -35,7 +35,7 @@ function _createMember(member) { api.createContact(createContact) .then(function (data) { console.debug('API called successfully. Returned data: ' + data); - if (data.id) { + if (data && data.id) { // Se ha dado de alta el contacto porque no existía createContact.ID = data.id; } @@ -116,6 +116,7 @@ function addMember(listId, member) { return new Promise(function (resolve, reject) { _createMember(member) .then(function(contact) { + console.debug('añadir a lista: ' + listId + ' * ' + contact); return _addMemberToList(contact, listId); }) .then(function() {