diff --git a/src/Yavsc/Services/ClientStore.cs b/src/Yavsc/Services/ClientStore.cs index a9ef06ee..68522e72 100644 --- a/src/Yavsc/Services/ClientStore.cs +++ b/src/Yavsc/Services/ClientStore.cs @@ -16,8 +16,8 @@ public class ClientStore : IClientStore public async Task FindClientByIdAsync(string clientId) { - var clientFromDb = await ApplicationDbContext.Client.FirstAsync(c => c.Id == clientId); - + var clientFromDb = await ApplicationDbContext.Client.FirstOrDefaultAsync(c => c.Id == clientId); + if (clientFromDb == null) return null; return new Client { ClientId = clientFromDb.Id,