Skip to content

Commit 5406f51

Browse files
committed
Check if arguments is an Array before calling #any? in Ripper translator
* We don't know what `on_*` events might return so safer to check it. * See #3838 (comment)
1 parent 38c64e5 commit 5406f51

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/prism/translation/ripper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def visit_call_node(node)
11121112
else
11131113
arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location))
11141114
call =
1115-
if node.opening_loc.nil? && arguments&.any?
1115+
if node.opening_loc.nil? && Array === arguments && arguments.any?
11161116
bounds(node.location)
11171117
on_command(message, arguments)
11181118
elsif !node.opening_loc.nil?

0 commit comments

Comments
 (0)