diff options
Diffstat (limited to '')
-rw-r--r-- | lib/models/user.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/models/user.js b/lib/models/user.js index 14c30bc3..e59b86cc 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -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 |