lib/jsonpath/enumerable.rb in jsonpath-0.5.2 vs lib/jsonpath/enumerable.rb in jsonpath-0.5.3

- old
+ new

@@ -50,9 +50,12 @@ else start_idx = process_function_or_literal(array_args[0], 0) next unless start_idx end_idx = (array_args[1] && process_function_or_literal(array_args[1], -1) || (sub_path.count(':') == 0 ? start_idx : -1)) next unless end_idx + if start_idx == end_idx + next unless start_idx < node.size + end end start_idx %= node.size end_idx %= node.size step = process_function_or_literal(array_args[2], 1) next unless step