Skip to content

Commit a99cac0

Browse files
authored
Merge pull request #550 from SISheogorath/fix/gitlabAvatar
Fix broken profile images in GitLab Fixes #549
2 parents 132d465 + 5002075 commit a99cac0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/models/user.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,12 @@ module.exports = function (sequelize, DataTypes) {
104104
break
105105
case 'gitlab':
106106
photo = profile.avatarUrl
107-
if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400')
108-
else photo = photo.replace(/(\?s=)\d*$/i, '$196')
107+
if (photo) {
108+
if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400')
109+
else photo = photo.replace(/(\?s=)\d*$/i, '$196')
110+
} else {
111+
photo = letterAvatars(profile.username)
112+
}
109113
break
110114
case 'dropbox':
111115
// no image api provided, use gravatar

0 commit comments

Comments
 (0)