From aab443e37a6e75ab0646052fb6ca3ade1a712551 Mon Sep 17 00:00:00 2001 From: zhiyuchen Date: Tue, 11 Dec 2012 11:10:25 -0800 Subject: [PATCH] add exception handling in nodes.rb --- lib/jsonpath/nodes.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jsonpath/nodes.rb b/lib/jsonpath/nodes.rb index 853dd97..21c70ce 100644 --- a/lib/jsonpath/nodes.rb +++ b/lib/jsonpath/nodes.rb @@ -198,8 +198,11 @@ def descend(*objects) next unless set.is_a?(Array) || set.is_a?(Hash) values = set.is_a?(Array) ? set : set.values values.each do |obj| - if execute(obj) - results << obj + begin + if execute(obj) + results << obj + end + rescue end end end