From ce0d83fe91988d2fadd506a53c84eb07c7c70374 Mon Sep 17 00:00:00 2001 From: Max Ward Date: Fri, 11 Nov 2022 10:57:43 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=20add=20null=20check=20for=20trans?= =?UTF-8?q?actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/utils/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/utils/index.js b/components/utils/index.js index 9345882..86d9222 100644 --- a/components/utils/index.js +++ b/components/utils/index.js @@ -12,6 +12,8 @@ import currencies from "../json/other/currencies.json"; class Utils { static getMostUsedCurrency(transactions) { + if(transactions == null) { return; } + const currenciesUsed = {}; transactions.forEach((a) => { if (currenciesUsed[a.currency]) {