Skip to content

Commit

Permalink
Adding null check for error code
Browse files Browse the repository at this point in the history
Fixing null pointer exception which is occurs when error code is null. This cause original exception to be lost.
  • Loading branch information
ersaxenas committed Apr 14, 2024
1 parent cda5934 commit 1355cf3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ private JMSException handleException(SdkException e, String operationName) {
}

private static String errorCode(AwsServiceException e) {
return e.awsErrorDetails() != null ? e.awsErrorDetails().errorCode() : "";
return e.awsErrorDetails() != null && e.awsErrorDetails().errorCode() != null ? e.awsErrorDetails().errorCode() : "";
}


Expand Down

0 comments on commit 1355cf3

Please sign in to comment.