Skip to content

Commit

Permalink
SpanEventFactory - adding null check on server port (#2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
meiao authored Nov 5, 2024
1 parent d1111df commit fbfe11b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ public SpanEventFactory setMessagingDestination(String messagingDestination) {
return this;
}

public SpanEventFactory setServerPort(int port) {
builder.putAgentAttribute(AttributeNames.SERVER_PORT, port);
public SpanEventFactory setServerPort(Integer port) {
if (port != null) {
builder.putAgentAttribute(AttributeNames.SERVER_PORT, port);
}
return this;
}

Expand Down

0 comments on commit fbfe11b

Please sign in to comment.