module JMESPath
  # @api private
  module Nodes
    class Or < Node
      def initialize(left, right)
        @left = left
        @right = right
      end

      def visit(value)
        result = @left.visit(value)
        if result == false || result.nil? || (result.respond_to?(:empty?) && result.empty?)
          @right.visit(value)
        else
          result
        end
      end

      def optimize
        self.class.new(@left.optimize, @right.optimize)
      end
    end
  end
end

module JMESPath
  # @api private
  module Nodes
    class Or < Node
      def initialize(left, right)
        @left = left
        @right = right
      end

      def visit(value)
        result = @left.visit(value)
        if result == false || result.nil? || result.empty?
          @right.visit(value)
        else
          result
        end
      end

      def optimize
        self.class.new(@left.optimize, @right.optimize)
      end
    end
  end
end

--- 
+++ 
@@ -9,7 +9,7 @@
 
       def visit(value)
         result = @left.visit(value)
-        if result == false || result.nil? || result.empty?
+        if result == false || result.nil? || (result.respond_to?(:empty?) && result.empty?)
           @right.visit(value)
         else
           result
Fix OR expressions where the left side is true

TrueClass does not respond to `#empty?`, which makes `foo || bar` where foo resolves to true fail.