diff --git a/js/main.js b/js/main.js index f9196ac..f408755 100644 --- a/js/main.js +++ b/js/main.js @@ -133,7 +133,7 @@ document.addEventListener("keydown", e => { history.index++; textCur.textContent = history.list[history.index]; cursorPosition = textCur.textContent.length; - } else { + } else if (history.index < history.list.length) { history.index++; textCur.textContent = ""; cursorPosition = 0;