Browse Source

Rescue ZeroDivisionError on validation, closes #2188

Stefan Siegl 7 years ago
parent
commit
4aaeb16d24
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/concerns/liquid_interpolatable.rb

+ 2 - 0
app/concerns/liquid_interpolatable.rb

@@ -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