Skip to content

Node.js based forum software built for the modern web

test: dont return cover:url if its not requested

Barış Soner Uşaklıe4d852b4ca69
diff --git a/src/user/data.js b/src/user/data.js
index e76e9975af..d222e24ac6 100644
--- a/src/user/data.js
+++ b/src/user/data.js
@@ -267,10 +267,11 @@ module.exports = function (User) {
user.picture = user.uploadedpicture;
}
}
-
- user['cover:url'] = user['cover:url'] ?
- prependRelativePath(user['cover:url']) :
- coverPhoto.getDefaultProfileCover(user.uid);
+ if (user.hasOwnProperty('cover:url')) {
+ user['cover:url'] = user['cover:url'] ?
+ prependRelativePath(user['cover:url']) :
+ coverPhoto.getDefaultProfileCover(user.uid);
+ }
if (meta.config.defaultAvatar && !user.picture) {
user.picture = User.getDefaultAvatar();