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