Skip to content

Commit 1355cf3

Browse files
committed
Adding null check for error code
Fixing null pointer exception which is occurs when error code is null. This cause original exception to be lost.
1 parent cda5934 commit 1355cf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ private JMSException handleException(SdkException e, String operationName) {
377377
}
378378

379379
private static String errorCode(AwsServiceException e) {
380-
return e.awsErrorDetails() != null ? e.awsErrorDetails().errorCode() : "";
380+
return e.awsErrorDetails() != null && e.awsErrorDetails().errorCode() != null ? e.awsErrorDetails().errorCode() : "";
381381
}
382382

383383

0 commit comments

Comments
 (0)