From f9bd43a4c38ab48f408c578de96a196df9474d1b Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 20 Mar 2023 00:44:10 +0000 Subject: [PATCH] Fix for NaN preferences breaking things. --- src/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 341a24c8..62fd86d8 100644 --- a/src/main.js +++ b/src/main.js @@ -159,7 +159,8 @@ const mixin = { (value = new URLSearchParams(window.location.search).get(key)) !== null || (this.testLocalStorage && (value = localStorage.getItem(key)) !== null) ) { - return Number(value); + const num = Number(value); + return isNaN(num) ? defaultVal : num; } else return defaultVal; }, getPreferenceJSON(key, defaultVal) {