Skip to content

Commit 23a8594

Browse files
authored
chore: Fixed issue with span links test (#3863)
1 parent 915b320 commit 23a8594

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/spans/span-link.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ class SpanLink {
6666
this.intrinsics.linkedSpanId = link.context.spanId
6767
this.intrinsics.linkedTraceId = link.context.traceId
6868

69-
for (const [key, value] of Object.entries(link.attributes)) {
70-
this.userAttributes.addAttribute(DESTINATIONS.TRANS_SEGMENT, key, value)
69+
if (Object.hasOwn(link, 'attributes') === true) {
70+
for (const [key, value] of Object.entries(link.attributes)) {
71+
this.userAttributes.addAttribute(DESTINATIONS.TRANS_SEGMENT, key, value)
72+
}
7173
}
7274
}
7375

0 commit comments

Comments
 (0)