From fc2d632ccfb8a723590081de4b50973c016e8742 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 17 Jun 2024 09:35:12 -0500 Subject: [PATCH] Guard against empty params --- config.ru | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.ru b/config.ru index 209997d..fdf923b 100644 --- a/config.ru +++ b/config.ru @@ -403,6 +403,8 @@ class JmpPay < Roda end def retail_rate(rates) + return unless rates&.first&.dig("total") + total = BigDecimal(rates.first["total"], 2) total *= 0.75 if params["currency"] == "USD" params["country-name"] == "US" ? total.round : total.ceil -- 2.45.2