summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSheogorath2017-10-08 22:20:35 +0200
committerGitHub2017-10-08 22:20:35 +0200
commita99cac0cf05acaddd38f21851e85ae542ebc0070 (patch)
treef8591896a65c4affdaf76137bd3ab60532aaa967 /lib
parent132d4657d792bed00a97281719354d005a35587d (diff)
parent500207545f072eeb59a8b27c143b2b517bf50452 (diff)
Merge pull request #550 from SISheogorath/fix/gitlabAvatar
Fix broken profile images in GitLab Fixes #549
Diffstat (limited to '')
-rw-r--r--lib/models/user.js8
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