mirror of
https://github.com/romancm/gamebrary
synced 2024-11-15 07:57:19 +00:00
Sort mutation null check
This commit is contained in:
parent
7d074ea7b9
commit
22a451e311
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue