0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fix gravatarLookup method

Closes #4511
- Add missing "return"
- Fix error handling
This commit is contained in:
sanddudu 2014-11-25 21:30:53 +08:00
parent 09658f8377
commit 904727a927

View file

@ -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) {