diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 622f1180..0a416eff 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -353,7 +353,7 @@ module Jekyll # Returns -1, 0, +1 or nil depending on whether this doc's path is less than, # equal or greater than the other doc's path. See String#<=> for more details. def <=>(other) - return nil if !other.respond_to?(:data) + return ArgumentError.new("document cannot be compared against #{other}") unless other.respond_to?(:data) cmp = data['date'] <=> other.data['date'] cmp = path <=> other.path if cmp == 0 cmp