Skip to content

Commit 1aaea52

Browse files
committed
PR feedback, avoid null-checking for activity
it is always not-null (checked in parent method)
1 parent bf3cac6 commit 1aaea52

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,7 @@ public HttpInListener(AspNetCoreTraceInstrumentationOptions options)
6060

6161
public override void OnEventWritten(string name, object? payload)
6262
{
63-
var activity = Activity.Current;
64-
65-
if (activity == null)
66-
{
67-
return;
68-
}
63+
var activity = Activity.Current!;
6964

7065
switch (name)
7166
{

0 commit comments

Comments
 (0)