mirror of
https://github.com/bitwarden/server
synced 2025-12-22 03:03:33 +00:00
current context null checks
This commit is contained in:
@@ -103,7 +103,7 @@ namespace Bit.Core.Services
|
|||||||
OrganizationId = collection.OrganizationId,
|
OrganizationId = collection.OrganizationId,
|
||||||
CollectionId = collection.Id,
|
CollectionId = collection.Id,
|
||||||
Type = type,
|
Type = type,
|
||||||
ActingUserId = _currentContext.UserId.Value,
|
ActingUserId = _currentContext?.UserId,
|
||||||
Date = DateTime.UtcNow
|
Date = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
await _eventWriteService.CreateAsync(e);
|
await _eventWriteService.CreateAsync(e);
|
||||||
@@ -116,7 +116,7 @@ namespace Bit.Core.Services
|
|||||||
OrganizationId = group.OrganizationId,
|
OrganizationId = group.OrganizationId,
|
||||||
GroupId = group.Id,
|
GroupId = group.Id,
|
||||||
Type = type,
|
Type = type,
|
||||||
ActingUserId = _currentContext.UserId.Value,
|
ActingUserId = _currentContext?.UserId,
|
||||||
Date = DateTime.UtcNow
|
Date = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
await _eventWriteService.CreateAsync(e);
|
await _eventWriteService.CreateAsync(e);
|
||||||
@@ -130,7 +130,7 @@ namespace Bit.Core.Services
|
|||||||
UserId = organizationUser.UserId,
|
UserId = organizationUser.UserId,
|
||||||
OrganizationUserId = organizationUser.Id,
|
OrganizationUserId = organizationUser.Id,
|
||||||
Type = type,
|
Type = type,
|
||||||
ActingUserId = _currentContext.UserId.Value,
|
ActingUserId = _currentContext?.UserId,
|
||||||
Date = DateTime.UtcNow
|
Date = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
await _eventWriteService.CreateAsync(e);
|
await _eventWriteService.CreateAsync(e);
|
||||||
@@ -142,7 +142,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
OrganizationId = organization.Id,
|
OrganizationId = organization.Id,
|
||||||
Type = type,
|
Type = type,
|
||||||
ActingUserId = _currentContext.UserId.Value,
|
ActingUserId = _currentContext?.UserId,
|
||||||
Date = DateTime.UtcNow
|
Date = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
await _eventWriteService.CreateAsync(e);
|
await _eventWriteService.CreateAsync(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user