diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SqsImpl.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SqsImpl.java index a3e2d0e770c8..41c772692d05 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SqsImpl.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SqsImpl.java @@ -137,7 +137,7 @@ static String getMessageAttribute(Request request, String name) { } static String getMessageId(Response response) { - if (response.getAwsResponse() instanceof SendMessageResult) { + if (response != null && response.getAwsResponse() instanceof SendMessageResult) { return ((SendMessageResult) response.getAwsResponse()).getMessageId(); } return null;