diff --git a/lib/haml_lint/tree/root_node.rb b/lib/haml_lint/tree/root_node.rb
index <HASH>..<HASH> 100644
--- a/lib/haml_lint/tree/root_node.rb
+++ b/lib/haml_lint/tree/root_node.rb
@@ -17,7 +17,9 @@ module HamlLint::Tree
     # @param line [Integer] the line number of the node
     # @return [HamlLint::Node]
     def node_for_line(line)
-      find(-> { HamlLint::Tree::NullNode.new }) { |node| node.line_numbers.cover?(line) }
+      find(-> { HamlLint::Tree::NullNode.new }) do |node|
+        node.line_numbers.cover?(line) && node != self
+      end
     end
   end
 end
Fix RootNode#node_for_line method on Ruby <I>

This method broke on Ruby <I> since `Range#cover?` now returns true for
beginless ranges where it previously returned false. This meant the
`RootNode` would match (as its `line_numbers` have no start nor end).

Fix by excluding the root node if it matches.