1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

PM 12001 - Fix Empty User Search 500 (#4770)

* Setting null if user2Fa is empty. Added null check to view as well.

* Not setting the temp data at all if empty.
This commit is contained in:
Jared McCannon
2024-09-13 12:03:53 -05:00
committed by GitHub
parent fd07de736d
commit e5c77d5f90
2 changed files with 9 additions and 2 deletions

View File

@ -66,7 +66,12 @@ public class UsersController : Controller
if (_featureService.IsEnabled(FeatureFlagKeys.MembersTwoFAQueryOptimization))
{
TempData["UsersTwoFactorIsEnabled"] = await _twoFactorIsEnabledQuery.TwoFactorIsEnabledAsync(users.Select(u => u.Id));
var user2Fa = (await _twoFactorIsEnabledQuery.TwoFactorIsEnabledAsync(users.Select(u => u.Id))).ToList();
// TempDataSerializer is having an issue serializing an empty IEnumerable<Tuple<T1,T2>>, do not set if empty.
if (user2Fa.Count != 0)
{
TempData["UsersTwoFactorIsEnabled"] = user2Fa;
}
}
return View(new UsersModel