aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rexml
diff options
context:
space:
mode:
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 )