mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 16:34:33 +00:00
Merge pull request #906 from SISheogorath/fix/letterAvatarMail
Fix possible weird objects as email
This commit is contained in:
commit
007f252273
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user