From 904727a927e1d495d2c849a5dc851f96de325cdc Mon Sep 17 00:00:00 2001 From: sanddudu Date: Tue, 25 Nov 2014 21:30:53 +0800 Subject: [PATCH] Fix gravatarLookup method Closes #4511 - Add missing "return" - Fix error handling --- core/server/models/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/server/models/user.js b/core/server/models/user.js index 203184d45e..444f8e500a 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -862,13 +862,13 @@ User = ghostBookshelf.Model.extend({ return new Promise(function (resolve) { if (config.isPrivacyDisabled('useGravatar')) { - resolve(userData); + return resolve(userData); } request({url: 'http:' + gravatarUrl, timeout: 2000}, function (err, response) { if (err) { // just resolve with no image url - resolve(userData); + return resolve(userData); } if (response.statusCode !== 404) {