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:
parent
14fa3287b7
commit
531d0fb261
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue