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 <martin@martinrogalla.com>
This commit is contained in:
Martin Jorn Rogalla 2015-02-26 22:12:06 +01:00
parent 14fa3287b7
commit 531d0fb261
1 changed files with 3 additions and 0 deletions

View File

@ -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