From 531d0fb261f428accfc0659b1232d9bf3c6ca873 Mon Sep 17 00:00:00 2001 From: Martin Jorn Rogalla Date: Thu, 26 Feb 2015 22:12:06 +0100 Subject: [PATCH] Sort will now raise error on nil object array input. Sort will now throw an error when a nil object array is given as input. See issue #3491 for more information. Signed-off-by: Martin Jorn Rogalla --- lib/jekyll/filters.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index d9c84fe88..e71710c9d 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -222,6 +222,9 @@ module Jekyll # # Returns the filtered array of objects def sort(input, property = nil, nils = "first") + if input.nil? + raise ArgumentError.new("Invalid object array given. Object array is null.") + end if property.nil? input.sort else