diff options
Diffstat (limited to 'Timeline/Controllers/UserController.cs')
-rw-r--r-- | Timeline/Controllers/UserController.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Timeline/Controllers/UserController.cs b/Timeline/Controllers/UserController.cs index 1231befb..eaa205de 100644 --- a/Timeline/Controllers/UserController.cs +++ b/Timeline/Controllers/UserController.cs @@ -82,7 +82,10 @@ namespace Timeline.Controllers [HttpGet("user/{username}/avatar"), Authorize] public async Task<IActionResult> GetAvatar([FromRoute] string username) { - // TODO: test user existence. + var existence = (await _userService.GetUser(username)) != null; + if (!existence) + return NotFound(); + var url = await _userService.GetAvatarUrl(username); return Redirect(url); } |