Skip to content

Commit c0dd048

Browse files
committed
[CLIENT] Verify that we have a response object before checking its status
1 parent d9337a9 commit c0dd048

File tree

1 file changed

+1
-1
lines changed
  • elasticsearch-transport/lib/elasticsearch/transport/transport

1 file changed

+1
-1
lines changed

elasticsearch-transport/lib/elasticsearch/transport/transport/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def perform_request(method, path, params={}, body=nil, headers=nil, &block)
284284
__raise_transport_error(response) if response.status.to_i >= 300 && @retry_on_status.include?(response.status.to_i)
285285

286286
rescue Elasticsearch::Transport::Transport::ServerError => e
287-
if @retry_on_status.include?(response.status)
287+
if response && @retry_on_status.include?(response.status)
288288
log_warn "[#{e.class}] Attempt #{tries} to get response from #{url}"
289289
if tries <= max_retries
290290
retry

0 commit comments

Comments
 (0)