Skip to content

Commit

Permalink
Merge pull request #42 from maxwellward/hotfix-no-transactions-crash
Browse files Browse the repository at this point in the history
Fix null exception when loading a package with no transactions
  • Loading branch information
Peter authored Nov 11, 2022
2 parents 4af3358 + ce0d83f commit b0b4319
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit b0b4319

Please sign in to comment.