From ed68f01ff50e16b78131298a545fa499d6927deb Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Tue, 26 May 2020 08:36:38 -0400 Subject: [PATCH] add case for when amount is undefined in formatCredits instead of returning '0' --- dist/bundle.es.js | 2 ++ src/util/format-credits.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 63eafa3..9e3c06a 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2665,6 +2665,8 @@ function numberWithCommas(x) { } function formatCredits(amount, precision, shortFormat = false) { + if (!amount) return '--'; + let actualAmount = parseFloat(amount); let actualPrecision = parseFloat(precision); let suffix = ''; diff --git a/src/util/format-credits.js b/src/util/format-credits.js index a090a33..627037d 100644 --- a/src/util/format-credits.js +++ b/src/util/format-credits.js @@ -5,6 +5,8 @@ function numberWithCommas(x) { } export function formatCredits(amount, precision, shortFormat = false) { + if (!amount) return '--'; + let actualAmount = parseFloat(amount); let actualPrecision = parseFloat(precision); let suffix = '';