From b4d9bd502ddba35c07a740e137fc69ce11ecc799 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Wed, 30 Jul 2025 15:45:50 +0100 Subject: [PATCH] Find the client --- src/Yavsc/Services/ClientStore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,