From 72a928c5ec26e1fdcd682e78667fa6ff1661e496 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 8 May 2020 17:27:54 -0700 Subject: [PATCH] Treat null and undefined equally --- ui/app/helpers/format-percentage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/helpers/format-percentage.js b/ui/app/helpers/format-percentage.js index cfd409c13..9bd2b6f0d 100644 --- a/ui/app/helpers/format-percentage.js +++ b/ui/app/helpers/format-percentage.js @@ -15,9 +15,9 @@ export function formatPercentage(params, options = {}) { let ratio; let total = options.total; - if (total !== undefined) { + if (total != undefined) { total = safeNumber(total); - } else if (complement !== undefined) { + } else if (complement != undefined) { total = value + safeNumber(complement); } else { // Ensures that ratio is between 0 and 1 when neither total or complement are defined