Fix possible weird objects as email
It seems like some providers return strange types for emails which cause problems. We default to something that is definitely a string. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
23bd1a18bb
commit
187401a876
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue