Never throw on `sample`
This commit is contained in:
parent
607ab66707
commit
2eb8469936
|
@ -312,7 +312,7 @@ module Jekyll
|
|||
|
||||
def sample(input, num = 1)
|
||||
return input unless input.respond_to?(:sample)
|
||||
num = Liquid::Utils.to_integer(num)
|
||||
num = Liquid::Utils.to_integer(num) rescue 1
|
||||
if num == 1
|
||||
input.sample
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue