Skip to content

Commit 007f252

Browse files
authored
Merge pull request #906 from SISheogorath/fix/letterAvatarMail
Fix possible weird objects as email
2 parents 72894d1 + 187401a commit 007f252

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/letter-avatars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ exports.generateAvatar = function (name) {
2727

2828
exports.generateAvatarURL = function (name, email = '', big = true) {
2929
let photo
30+
if (typeof email !== 'string') {
31+
email = '' + name + '@example.com'
32+
}
33+
3034
if (email !== '' && config.allowGravatar) {
3135
photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase())
3236
if (big) {

0 commit comments

Comments
 (0)