From acd8b817f4957839649de957383353382d21c00c Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 26 Feb 2025 00:08:04 +0200 Subject: [PATCH] Improve number type conversion in getConfigValue to handle NaN cases --- src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index 17356c985..e98eb4978 100644 --- a/src/util.js +++ b/src/util.js @@ -76,7 +76,7 @@ export function getConfigValue(key, defaultValue = null, typeConverter = null) { const value = _getValue(); switch (typeConverter) { case 'number': - return Number(value); + return isNaN(parseFloat(value)) ? defaultValue : parseFloat(value); case 'boolean': return toBoolean(value); default: