From b233abd07f7e0fc2097f435974898c29de41a9f5 Mon Sep 17 00:00:00 2001 From: Max Smiley Date: Wed, 24 Jul 2024 22:10:42 +0000 Subject: [PATCH] Fix NPE on failure to parse AWSError when determing whether to retry request --- .../java/org/jclouds/s3/handlers/S3RedirectionRetryHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/s3/src/main/java/org/jclouds/s3/handlers/S3RedirectionRetryHandler.java b/apis/s3/src/main/java/org/jclouds/s3/handlers/S3RedirectionRetryHandler.java index bfbef0ca61..638538da91 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/handlers/S3RedirectionRetryHandler.java +++ b/apis/s3/src/main/java/org/jclouds/s3/handlers/S3RedirectionRetryHandler.java @@ -53,7 +53,7 @@ public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { 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