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:
@ -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
|
||||
|
Reference in New Issue
Block a user