diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js index 53fa011..55cf9c3 100644 --- a/lib/letter-avatars.js +++ b/lib/letter-avatars.js @@ -27,6 +27,10 @@ exports.generateAvatar = function (name) { exports.generateAvatarURL = function (name, email = '', big = true) { let photo + if (typeof email !== 'string') { + email = '' + name + '@example.com' + } + if (email !== '' && config.allowGravatar) { photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase()) if (big) {