Skip to content

Commit b980680

Browse files
committed
Fixes checking for endpoint opts in ES perform_request
1 parent 8b1c51d commit b980680

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elasticsearch/lib/elasticsearch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def method_missing(name, *args, &block)
6363
# The last arg is opts, which shouldn't be sent when `perform_request` is called
6464
# directly. Check if :endpoint is a key, which means it's the extra identifier
6565
# used for OpenTelemetry.
66-
args.pop if args[-1][:endpoint]
66+
args.pop if args[-1].is_a?(Hash) && args[-1][:endpoint]
6767
if (opaque_id = args[2]&.delete(:opaque_id))
6868
headers = args[4] || {}
6969
opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id

0 commit comments

Comments
 (0)