diff --git a/web/src/views/CreateJoin.vue b/web/src/views/CreateJoin.vue index a49cf1c..9c19465 100644 --- a/web/src/views/CreateJoin.vue +++ b/web/src/views/CreateJoin.vue @@ -23,9 +23,12 @@ export default { createGame() { this.name = prompt(`What is your name?`); - this.$socket.client.emit(`CreateGame`, { - name: this.name, - }); + // Assert that the user entered a name and didn't cancel + if (this.name) { + this.$socket.client.emit(`CreateGame`, { + name: this.name, + }); + }; }, joinGame() { // Get the user's name