From 34a21c6d8cb2651846a692a7532f0520aaebc47b Mon Sep 17 00:00:00 2001 From: Lartza Date: Fri, 24 Jan 2020 02:29:11 +0200 Subject: [PATCH] Handle invalid current minDuration in options.js --- options/options.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/options/options.js b/options/options.js index 875c046f..22529d9e 100644 --- a/options/options.js +++ b/options/options.js @@ -75,13 +75,16 @@ async function init() { let configValue = SB.config[numberChangeOption]; let numberInput = optionsElements[i].querySelector("input"); - if (configValue != undefined) { + if (isNaN(configValue) || configValue < 0) { + numberInput.value = 0; + } else { numberInput.value = configValue; } numberInput.addEventListener("input", () => { SB.config[numberChangeOption] = numberInput.value; }); + break; } }