Skip to content

Commit

Permalink
Merge pull request #2436 from teamcapybara/issue_2435
Browse files Browse the repository at this point in the history
Protect against optimization returning nil
  • Loading branch information
twalpole committed Jan 7, 2021
2 parents ca4f9aa + 9d533a3 commit 7f8c078
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/selenium/extensions/find.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def gather_hints(elements, uses_visibility:, styles:, position:)
hints_js, functions = build_hints_js(uses_visibility, styles, position)
return [] unless functions.any?

es_context.execute_script(hints_js, elements).map! do |results|
(es_context.execute_script(hints_js, elements) || []).map! do |results|
hint = {}
hint[:style] = results.pop if functions.include?(:style_func)
hint[:position] = results.pop if functions.include?(:position_func)
Expand Down

0 comments on commit 7f8c078

Please sign in to comment.