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
					
				@ -27,6 +27,10 @@ exports.generateAvatar = function (name) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
exports.generateAvatarURL = function (name, email = '', big = true) {
 | 
					exports.generateAvatarURL = function (name, email = '', big = true) {
 | 
				
			||||||
  let photo
 | 
					  let photo
 | 
				
			||||||
 | 
					  if (typeof email !== 'string') {
 | 
				
			||||||
 | 
					    email = '' + name + '@example.com'
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (email !== '' && config.allowGravatar) {
 | 
					  if (email !== '' && config.allowGravatar) {
 | 
				
			||||||
    photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase())
 | 
					    photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase())
 | 
				
			||||||
    if (big) {
 | 
					    if (big) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user