Fix broken profile images

This commit is contained in:
Sheogorath 2017-09-22 12:40:43 +02:00
parent d1d6d5810b
commit 500207545f
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD

View file

@ -104,8 +104,12 @@ module.exports = function (sequelize, DataTypes) {
break
case 'gitlab':
photo = profile.avatarUrl
if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400')
else photo = photo.replace(/(\?s=)\d*$/i, '$196')
if (photo) {
if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400')
else photo = photo.replace(/(\?s=)\d*$/i, '$196')
} else {
photo = letterAvatars(profile.username)
}
break
case 'dropbox':
// no image api provided, use gravatar