mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 01:10:41 -07:00
fix ordering of checks
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
require 'cgi'
|
||||
require 'base64'
|
||||
require 'bigdecimal'
|
||||
|
||||
module Liquid
|
||||
module StandardFilters
|
||||
MAX_I32 = (1 << 31) - 1
|
||||
@@ -986,15 +985,15 @@ module Liquid
|
||||
attr_reader :context
|
||||
|
||||
def filter_array(input, property, target_value, default_value = [], &block)
|
||||
ary = InputIterator.new(input, context)
|
||||
return default_value if ary.empty?
|
||||
|
||||
if property.nil?
|
||||
raise_property_error(property)
|
||||
end
|
||||
|
||||
property = Liquid::Utils.to_s(property)
|
||||
|
||||
ary = InputIterator.new(input, context)
|
||||
return default_value if ary.empty?
|
||||
|
||||
block.call(ary) do |item|
|
||||
if target_value.nil?
|
||||
item[property]
|
||||
|
||||
Reference in New Issue
Block a user