From 14b3b355194d00d9c85d13790bad79a88e9d2631 Mon Sep 17 00:00:00 2001 From: olafbuitelaar Date: Thu, 29 Aug 2024 14:25:41 +0200 Subject: [PATCH] null check config.rate and config.defaultRate (#12175) --- modules/currency.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/currency.js b/modules/currency.js index aa464b81f9a..8ac2b8cbead 100644 --- a/modules/currency.js +++ b/modules/currency.js @@ -62,13 +62,13 @@ export let responseReady = defer(); export function setConfig(config) { ratesURL = DEFAULT_CURRENCY_RATE_URL; - if (typeof config.rates === 'object') { + if (config.rates !== null && typeof config.rates === 'object') { currencyRates.conversions = config.rates; currencyRatesLoaded = true; needToCallForCurrencyFile = false; // don't call if rates are already specified } - if (typeof config.defaultRates === 'object') { + if (config.defaultRates !== null && typeof config.defaultRates === 'object') { defaultRates = config.defaultRates; // set up the default rates to be used if the rate file doesn't get loaded in time