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