@ -13,7 +13,8 @@ this.Commands = {
promptTranscript: function() {
if (Livechat.transcript) {
let email = Meteor.user().emails[0].address || '';
const user = Meteor.user();
let email = user.emails && user.emails.length > 0 ? user.emails[0].address : '';
swal({
title: t('Chat_ended'),
@ -60,4 +61,4 @@ this.Commands = {
});
}
};