diff options
author | Sheogorath | 2017-09-22 12:40:43 +0200 |
---|---|---|
committer | Sheogorath | 2017-09-22 12:40:43 +0200 |
commit | 500207545f072eeb59a8b27c143b2b517bf50452 (patch) | |
tree | 04231446329d97e33ad143df83177d195b0203e8 /lib/models | |
parent | d1d6d5810b12645ddb02275ce0c2498b2189a8a0 (diff) |
Fix broken profile images
Diffstat (limited to 'lib/models')
-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 |