From b917ea1fd2557320aab51dd847dcdcbfe0f4978b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 12 Dec 2017 15:23:45 -0500 Subject: [PATCH] current context null checks --- src/Core/Services/Implementations/EventService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Core/Services/Implementations/EventService.cs b/src/Core/Services/Implementations/EventService.cs index f604d2ef6..059fd2ece 100644 --- a/src/Core/Services/Implementations/EventService.cs +++ b/src/Core/Services/Implementations/EventService.cs @@ -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);