1
0
mirror of https://github.com/bitwarden/server synced 2026-02-24 00:23:05 +00:00

[PM-28023] Fix restoring revoked invited users in Free Organizations (#6861)

* Fix null reference when restoring invited users in Free orgs

Add null check before querying for other free org ownership. Invited
users don't have a UserId yet, causing NullReferenceException.

* Add regression test for restoring revoked invited users with null UserId.
This commit is contained in:
Rui Tomé
2026-01-21 11:27:24 +00:00
committed by GitHub
parent 439485fc16
commit 7fb2822e05
2 changed files with 34 additions and 1 deletions

View File

@@ -93,7 +93,7 @@ public class RestoreOrganizationUserCommand(
.twoFactorIsEnabled;
}
if (organization.PlanType == PlanType.Free)
if (organization.PlanType == PlanType.Free && organizationUser.UserId.HasValue)
{
await CheckUserForOtherFreeOrganizationOwnershipAsync(organizationUser);
}