From da5bc280b65c05d76a65083fd7b8dfd330e7acd3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 18 Dec 2023 15:40:40 +0100 Subject: Don't try to Invite with empty field. --- public/join.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/join.js b/public/join.js index cc8d325..185aa6c 100644 --- a/public/join.js +++ b/public/join.js @@ -46,8 +46,10 @@ function accept(role) { function send_invite() { let invite_user = document.getElementById("invite_user").value - post(`/invite/${game.game_id}/${encodeURIComponent(invite_role)}/${encodeURIComponent(invite_user)}`) - document.getElementById("invite").close() + if (invite_user) { + post(`/invite/${game.game_id}/${encodeURIComponent(invite_role)}/${encodeURIComponent(invite_user)}`) + document.getElementById("invite").close() + } } function show_invite(role) { -- cgit v1.2.3