Skip to content

Commit

Permalink
Merge pull request #2189 from stesie/issue-2188
Browse files Browse the repository at this point in the history
Rescue ZeroDivisionError on validation
  • Loading branch information
knu committed Jan 8, 2018
2 parents cefdd1c + 4aaeb16 commit fc1daf8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/concerns/liquid_interpolatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def valid?(context = nil)

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
Expand Down

0 comments on commit fc1daf8

Please sign in to comment.