mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
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) ->
|
||||
@modelClass.findById(id).exec (err, document) =>
|
||||
return @sendDatabaseError(res, err) if err
|
||||
return @sendNotFoundError(res) unless document
|
||||
photoURL = document?.get('photoURL')
|
||||
if photoURL
|
||||
photoURL = "/file/#{photoURL}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue