summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-17 14:47:20 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-17 14:47:20 +0000
commitd8c3fa15069932cac36790df2485d148f7f4c807 (patch)
tree1474cb856a60bda6b86312734c973ace60a8c7bb /lib/rexml
parent7bf12316a1716c2116908c494e9e259dc39eb8a5 (diff)
* lib/rexml/xpath_parser.rb, test/rexml/test_xpath.rb:
add missing method availability check. [ruby-core:32447] Reported by Wiebe Cazemier. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/xpath_parser.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 11950ecd93..d9088a25d9 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -434,7 +434,8 @@ module REXML
when :and
left = expr( path_stack.shift, nodeset.dup, context )
#puts "LEFT => #{left.inspect} (#{left.class.name})"
- if left == false || left.nil? || !left.inject(false) {|a,b| a | b}
+ return [] unless left
+ if left.respond_to?(:inject) and !left.inject(false) {|a,b| a | b}
return []
end
right = expr( path_stack.shift, nodeset.dup, context )