Skip to content

Commit

Permalink
Fix for null connection test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Gagan Juneja <[email protected]>
  • Loading branch information
Gagan Juneja committed Oct 5, 2023
1 parent 1eec0f1 commit 0d83a0d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private static Attributes buildSpanAttributes(RestRequest restRequest) {
}

private static String createSpanName(String action, Transport.Connection connection) {
return action + SEPARATOR + (connection.getNode() != null ? connection.getNode().getHostAddress() : null);
return action + SEPARATOR + ((connection != null && connection.getNode() != null) ? connection.getNode().getHostAddress() : null);
}

private static Attributes buildSpanAttributes(String action, Transport.Connection connection) {
Expand Down

0 comments on commit 0d83a0d

Please sign in to comment.