Browse Source

Add null check for retry policy. Fixes #101

pull/148/head
Ryan Baxter 6 years ago
parent
commit
a693c30930
  1. 2
      spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/ribbon/RetryableFeignLoadBalancer.java

2
spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/ribbon/RetryableFeignLoadBalancer.java

@ -101,7 +101,7 @@ public class RetryableFeignLoadBalancer extends FeignLoadBalancer implements Ser @@ -101,7 +101,7 @@ public class RetryableFeignLoadBalancer extends FeignLoadBalancer implements Ser
feignRequest = request.toRequest();
}
Response response = request.client().execute(feignRequest, options);
if (retryPolicy.retryableStatusCode(response.status())) {
if (retryPolicy != null && retryPolicy.retryableStatusCode(response.status())) {
byte[] byteArray = response.body() == null ? new byte[]{} : StreamUtils.copyToByteArray(response.body().asInputStream());
response.close();
throw new RibbonResponseStatusCodeException(RetryableFeignLoadBalancer.this.clientName, response,

Loading…
Cancel
Save