Sort mutation null check

This commit is contained in:
Roman Cervantes 2019-03-29 13:43:12 -07:00
parent 7d074ea7b9
commit 22a451e311

View file

@ -83,8 +83,13 @@ export default {
const games = state.gameLists[state.platform.code][listIndex].games;
games.sort((a, b) => {
const gameA = state.games[a].name.toUpperCase();
const gameB = state.games[b].name.toUpperCase();
const gameA = state.games[a] && state.games[a].name
? state.games[a].name.toUpperCase()
: '';
const gameB = state.games[b] && state.games[b].name
? state.games[b].name.toUpperCase()
: '';
if (gameA < gameB) {
return -1;