null checks

This commit is contained in:
Roman Cervantes 2019-12-18 00:24:33 -07:00
parent ee3a79f119
commit 54204bf88f
2 changed files with 5 additions and 1 deletions

View file

@ -21,7 +21,10 @@ export default {
}, },
gameProgress() { 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() { gameCardClass() {

View file

@ -101,6 +101,7 @@ export default {
gameProgress: ({ game, progresses, platform }) => { gameProgress: ({ game, progresses, platform }) => {
const gameSelected = game && game.id; const gameSelected = game && game.id;
const hasProgress = gameSelected const hasProgress = gameSelected
&& platform
&& progresses[platform.code] && progresses[platform.code]
&& progresses[platform.code][game.id]; && progresses[platform.code][game.id];