diff --git a/DysonNetwork.Pass/Account/AccountCurrentController.cs b/DysonNetwork.Pass/Account/AccountCurrentController.cs index ab57691..9be46ce 100644 --- a/DysonNetwork.Pass/Account/AccountCurrentController.cs +++ b/DysonNetwork.Pass/Account/AccountCurrentController.cs @@ -571,12 +571,12 @@ public class AccountCurrentController( .Where(device => device.AccountId == currentUser.Id) .ToListAsync(); - var sessionDevices = devices.Select(SnAuthClientWithSessions.FromClient).ToList(); + var sessionDevices = devices.ConvertAll(SnAuthClientWithSessions.FromClient).ToList(); var clientIds = sessionDevices.Select(x => x.Id).ToList(); var authSessions = await db.AuthSessions - .Where(c => clientIds.Contains(c.Id)) - .GroupBy(c => c.Id) + .Where(c => c.ClientId != null && clientIds.Contains(c.ClientId.Value)) + .GroupBy(c => c.ClientId!.Value) .ToDictionaryAsync(c => c.Key, c => c.ToList()); foreach (var dev in sessionDevices) if (authSessions.TryGetValue(dev.Id, out var challenge)) @@ -956,4 +956,4 @@ public class AccountCurrentController( .ToListAsync(); return Ok(records); } -} \ No newline at end of file +}