Fix for NaN preferences breaking things.

This commit is contained in:
Kavin 2023-03-20 00:44:10 +00:00
parent 1c5d0f7017
commit f9bd43a4c3
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -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) {