diff --git a/frontend/src/ts/popups/custom-test-duration-popup.ts b/frontend/src/ts/popups/custom-test-duration-popup.ts index ccf0e15b1..6d485b87f 100644 --- a/frontend/src/ts/popups/custom-test-duration-popup.ts +++ b/frontend/src/ts/popups/custom-test-duration-popup.ts @@ -101,7 +101,7 @@ export function hide(): void { function apply(): void { const val = parseInput($("#customTestDurationPopup input").val() as string); - if (val !== null && !isNaN(val) && val >= 0) { + if (val !== null && !isNaN(val) && val >= 0 && isFinite(val)) { UpdateConfig.setTimeConfig(val as MonkeyTypes.TimeModes); ManualRestart.set(); TestLogic.restart(); diff --git a/frontend/src/ts/popups/custom-word-amount-popup.ts b/frontend/src/ts/popups/custom-word-amount-popup.ts index 4b2c440ca..433899884 100644 --- a/frontend/src/ts/popups/custom-word-amount-popup.ts +++ b/frontend/src/ts/popups/custom-word-amount-popup.ts @@ -35,7 +35,7 @@ export function hide(): void { function apply(): void { const val = parseInt($("#customWordAmountPopup input").val() as string); - if (val !== null && !isNaN(val) && val >= 0) { + if (val !== null && !isNaN(val) && val >= 0 && isFinite(val)) { UpdateConfig.setWordCount(val as MonkeyTypes.WordsModes); ManualRestart.set(); TestLogic.restart();