Fix NPE on failure to parse AWSError when determing whether to retry request

This commit is contained in:
Max Smiley
2024-07-24 22:10:42 +00:00
committed by Andrew Gaul
parent 0e1eee0457
commit 1f181bf00c
@@ -53,7 +53,7 @@ public class S3RedirectionRetryHandler extends RedirectionRetryHandler {
command.incrementRedirectCount();
closeClientButKeepContentStream(response);
AWSError error = utils.parseAWSErrorFromContent(command.getCurrentRequest(), response);
String host = error.getDetails().get("Endpoint");
String host = error == null ? null : error.getDetails().get("Endpoint");
if (host != null) {
if (host.equals(command.getCurrentRequest().getEndpoint().getHost())) {
// must be an amazon error related to