Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/jsonpath/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def handle_wildecard(node, expr, _context, _key, pos, &blk)
else
next if node.is_a?(Array) && node.empty?
next if node.nil? # when default_path_leaf_to_null is true
next if node.size.zero?

array_args = sub_path.split(':')
if array_args[0] == '*'
Expand All @@ -81,6 +82,7 @@ def handle_wildecard(node, expr, _context, _key, pos, &blk)
next unless end_idx
next if start_idx == end_idx && start_idx >= node.size
end

start_idx %= node.size
end_idx %= node.size
step = process_function_or_literal(array_args[2], 1)
Expand Down