Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public static class HttpContextSetUser

private const string HttpContextExtensionsTypeName = "Microsoft.AspNetCore.Http.DefaultHttpContext";

internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance, ref ClaimsPrincipal claimsPrincipal)
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance, ref ClaimsPrincipal? claimsPrincipal)
{
if (Security.Instance is { IsTrackUserEventsEnabled: true } security)
{
var tracer = Tracer.Instance;
var scope = tracer.InternalActiveScope;
if (instance is HttpContext httpContext && scope is not null)
if (instance is HttpContext httpContext && scope is not null && claimsPrincipal is not null)
{
var span = scope.Span;
var foundUserId = false;
Expand Down
Loading