From 3b38ba3a29d2af392c1530cf3e80d6f0b476e4a0 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Wed, 28 Aug 2024 18:47:03 +0800 Subject: [PATCH] Make split number helper handle empty value (#20848) no issues --- ghost/admin/app/helpers/split-number.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghost/admin/app/helpers/split-number.js b/ghost/admin/app/helpers/split-number.js index d136c4a832..27c5d0bda7 100644 --- a/ghost/admin/app/helpers/split-number.js +++ b/ghost/admin/app/helpers/split-number.js @@ -3,6 +3,10 @@ import {helper} from '@ember/component/helper'; import {htmlSafe} from '@ember/template'; export function splitNumber([number, previousNumber]) { + if (number === undefined || previousNumber === undefined) { + return 0; + } + let formattedNewNumber = formatNumber(number); let formattedOldNumber = formatNumber(previousNumber);