From fdd0b19a4c9529a3e316d5bf34a7377e70e7684e Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 8 Jan 2021 23:12:28 -0700 Subject: [PATCH] Fix error on trying to see if the game has been won when there's not even an object chosen yet. --- web/src/components/Hand.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/components/Hand.vue b/web/src/components/Hand.vue index fff3911..0d97e08 100644 --- a/web/src/components/Hand.vue +++ b/web/src/components/Hand.vue @@ -67,9 +67,12 @@ export default { return this.$store.state.questions; }, gameOver() { - let targetAnswer = this.$store.state.chosen_object.toLowerCase()+`.`; - return this.$store.state.answers.team_1.includes(targetAnswer) - || this.$store.state.answers.team_2.includes(targetAnswer); + if (this.$store.state.chosen_object) { + let targetAnswer = this.$store.state.chosen_object.toLowerCase()+`.`; + return this.$store.state.answers.team_1.includes(targetAnswer) + || this.$store.state.answers.team_2.includes(targetAnswer); + }; + return false; }, }, methods: {