Skip to content

Commit 4b98ecb

Browse files
authored
fix(multiple_queries): allow params to be nil (#478)
| **Q** | **A** | |----------------|-------| | Bug fix? | yes | | New feature? | no | | BC breaks? | no | | Need Doc update | no | # Describe your change Skip call to `to_query_string` in `multiple_queries` if `:params` is nil # What problem is this fixing? `params` is documented as an optional argument of `multiple_queries`, but a recent change introducing a call to `to_query_string` triggers an error if `params` is not present (undefined method `map' for nil:NilClass)
1 parent 87bd348 commit 4b98ecb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/algolia/search_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def multiple_get_objects(requests, opts = {})
479479
#
480480
def multiple_queries(queries, opts = {})
481481
queries.each do |q|
482-
q[:params] = to_query_string(q[:params]) unless q[:params].is_a?(String)
482+
q[:params] = to_query_string(q[:params]) unless q[:params].nil? || q[:params].is_a?(String)
483483
end
484484
@transporter.read(:POST, '/1/indexes/*/queries', { requests: queries }, opts)
485485
end

0 commit comments

Comments
 (0)