diff --git a/index.js b/index.js index ab7099a..7b5f15a 100644 --- a/index.js +++ b/index.js @@ -304,6 +304,12 @@ wss.on('connection', ws => { let salaClientes = salaObj.clientes; let e = Util.receberClientePorApelido(salaObj, salaObj.vezDe); // escolhedor + // O termo está vazio? + if (resposta.extra.termo.replace(/ /g, "") === ""){ + ws.send(JSON.stringify(new Resposta("PEDIDO_CANCELADO", "SERVIDOR", "TERMO_INVÁLIDO"))); + return; + } + /*// A sala está aceitando apenas letras? if (salaObj.estadoTermo === "AGUARDANDO_LETRA" && !letra){ // A sala não está esperando termos.