From: Christian Heller Date: Mon, 14 Dec 2020 21:25:12 +0000 (+0100) Subject: In web client index selection, disallow non-number replies. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/static/%7B%7Bprefix%7D%7D/test.html?a=commitdiff_plain;h=769c9a9af7f759f89593c5136a1359ce35366fbc;p=plomrogue2 In web client index selection, disallow non-number replies. --- diff --git a/rogue_chat.html b/rogue_chat.html index dd8de5b..d810c2e 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -1045,7 +1045,7 @@ let tui = { }, pick_selectable: function(task_name) { const i = parseInt(this.inputEl.value); - if (isNaN(i) || i < 0 || i >= this.selectables.length) { + if (isNaN(this.inputEl.value) || i < 0 || i >= this.selectables.length) { tui.log_msg('? invalid index, aborted'); } else { server.send(['TASK:' + task_name, tui.selectables[i]]);