patch to fix gameData is undefined

This commit is contained in:
Sorrel 2020-07-01 14:56:07 -07:00 committed by GitHub
parent c4192f2e33
commit a3420c1152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,7 +188,7 @@ const Game = ({ gameData = {}, gameRecord = [] } = {}) => {
Game({ gameData }).initGame()
);
// ? why is this being wrapped?
if (gameData.gameData.winner) {
if (gameData?.gameData?.winner) {
const { winner, score } = gameData.gameData;
return game.manualEnd({ winner, score });
}