Prevent error if options is not defined.
This commit is contained in:
parent
9689b23007
commit
76e667142f
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue