Protect against undefined property error
This commit is contained in:
parent
7e12fa253a
commit
a5ee46bfb2
1 changed files with 2 additions and 2 deletions
|
|
@ -27,8 +27,8 @@ export default (io: Server, socket: Socket, data: StartGame) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ensure the questions deck got populated
|
// Ensure the questions deck got populated
|
||||||
if (game.questions.size <= 0) {
|
if (game.questions?.size <= 0) {
|
||||||
game.log.error(`Questions deck has no cards before the game started.`);
|
game.log.error(`The questions deck has no cards in the deck.`);
|
||||||
socket.emit(`GameStarted`, {
|
socket.emit(`GameStarted`, {
|
||||||
status: 507,
|
status: 507,
|
||||||
message: `Questions deck failed to parse, try again in a few seconds or start a new game.`,
|
message: `Questions deck failed to parse, try again in a few seconds or start a new game.`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue