Fixed the avatar endpoint handling when the user object DNE.
This commit is contained in:
parent
ccb2ad67ac
commit
c145f8088c
1 changed files with 1 additions and 0 deletions
|
@ -219,6 +219,7 @@ UserHandler = class UserHandler extends Handler
|
||||||
avatar: (req, res, id) ->
|
avatar: (req, res, id) ->
|
||||||
@modelClass.findById(id).exec (err, document) =>
|
@modelClass.findById(id).exec (err, document) =>
|
||||||
return @sendDatabaseError(res, err) if err
|
return @sendDatabaseError(res, err) if err
|
||||||
|
return @sendNotFoundError(res) unless document
|
||||||
photoURL = document?.get('photoURL')
|
photoURL = document?.get('photoURL')
|
||||||
if photoURL
|
if photoURL
|
||||||
photoURL = "/file/#{photoURL}"
|
photoURL = "/file/#{photoURL}"
|
||||||
|
|
Reference in a new issue