Skip to content

Commit 72774ca

Browse files
Fix NullReferenceException in TryToCompressRegular method in Span (#2602)
Fix NullReferenceException in method TryToCompressRegular of Span
1 parent c72b143 commit 72774ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Elastic.Apm/Model/Span.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,11 @@ private bool TryToCompressRegular(Span sibling)
645645
{
646646
Composite ??= new Composite();
647647
Composite.CompressionStrategy = "same_kind";
648-
if (_context.IsValueCreated && Context.Service?.Target != null)
648+
if (_context.IsValueCreated && Context?.Service?.Target != null)
649+
{
649650
Name = "Calls to " + Context.Service.Target.ToDestinationServiceResource();
651+
}
652+
650653
return true;
651654
}
652655

0 commit comments

Comments
 (0)