Rescue ZeroDivisionError on validation, closes #2188

This commit is contained in:
Stefan Siegl 2018-01-05 12:38:46 +01:00
parent cefdd1c01d
commit 4aaeb16d24
No known key found for this signature in database
GPG key ID: 73942AF5642F3DDA

View file

@ -15,6 +15,8 @@ module LiquidInterpolatable
def validate_interpolation
interpolated
rescue Liquid::ZeroDivisionError => e
# Ignore error (likely due to possibly missing variables on "divided_by")
rescue Liquid::Error => e
errors.add(:options, "has an error with Liquid templating: #{e.message}")
rescue