Fixed the avatar endpoint handling when the user object DNE.

This commit is contained in:
Scott Erickson 2014-07-17 09:12:12 -07:00
parent ccb2ad67ac
commit c145f8088c

View file

@ -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}"