diff --git a/app/services/tax_rate_finder.rb b/app/services/tax_rate_finder.rb index f27a42ef85..01b955d3d0 100644 --- a/app/services/tax_rate_finder.rb +++ b/app/services/tax_rate_finder.rb @@ -75,7 +75,7 @@ class TaxRateFinder # to the included tax. def find_closest_tax_rates_from_included_tax(amount, included_tax) approximation = (included_tax / (amount - included_tax)) - return [] if approximation.infinite? || approximation.zero? + return [] if approximation.infinite? || approximation.zero? || approximation.nan? [Spree::TaxRate.order("ABS(amount - #{approximation})").first] end