From 76e667142f2ed6173a38cb5263ce4f9ed49607a0 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 7 Jan 2021 15:33:37 -0700 Subject: [PATCH] Prevent error if options is not defined. --- server/src/objects/Game.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/objects/Game.ts b/server/src/objects/Game.ts index 0087324..d26f042 100644 --- a/server/src/objects/Game.ts +++ b/server/src/objects/Game.ts @@ -23,7 +23,7 @@ export class Game { this.host = host; this.ingame = false; this.players = [host]; - this.id = options.id || Game.generateID(conf.game.code_length); + this.id = options?.id || Game.generateID(conf.game.code_length); // If the object is being instantiated from JSON we don't want to do // any of the stuff that requires weird per-game stuff