Skip to content

Commit 5002075

Browse files
committed
Fix broken profile images
1 parent d1d6d58 commit 5002075

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)