diff --git a/DrinkRateAPI/Services/ApplicationUserService.cs b/DrinkRateAPI/Services/ApplicationUserService.cs index a2f735d..7df4ac0 100644 --- a/DrinkRateAPI/Services/ApplicationUserService.cs +++ b/DrinkRateAPI/Services/ApplicationUserService.cs @@ -13,7 +13,7 @@ public class ApplicationUserService(ApplicationDbContext context) { var appUserId = identity.FindFirst(ClaimTypes.NameIdentifier)?.Value; var profile = await _context.UserProfiles - .FirstAsync(x => x.ApplicationUserId.ToString() == appUserId) + .FirstOrDefaultAsync(x => x.ApplicationUserId.ToString() == appUserId) ?? throw new NotFoundException(); return profile;