From 54204bf88fca1e29ae970b6059861ecb5130aa0f Mon Sep 17 00:00:00 2001 From: Roman Cervantes Date: Wed, 18 Dec 2019 00:24:33 -0700 Subject: [PATCH] null checks --- src/components/GameCards/GameCard.js | 5 ++++- src/store/getters.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/GameCards/GameCard.js b/src/components/GameCards/GameCard.js index 6a52989f..232579c1 100644 --- a/src/components/GameCards/GameCard.js +++ b/src/components/GameCards/GameCard.js @@ -21,7 +21,10 @@ export default { }, gameProgress() { - return this.game && this.progresses[this.platform.code][this.game.id]; + return this.game + && this.platform + && this.progresses[this.platform.code] + && this.progresses[this.platform.code][this.game.id]; }, gameCardClass() { diff --git a/src/store/getters.js b/src/store/getters.js index c8f3fcb0..87f012fd 100755 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -101,6 +101,7 @@ export default { gameProgress: ({ game, progresses, platform }) => { const gameSelected = game && game.id; const hasProgress = gameSelected + && platform && progresses[platform.code] && progresses[platform.code][game.id];