Fix nil pointer dereference.

This commit is contained in:
Marco 2023-07-11 18:21:54 +02:00
parent a3e6ab31c3
commit a93b1a1aca

View File

@ -34,7 +34,7 @@ func (u *Usher) CreateNewPrivateLobby(player *chess.Player) *lobbies.Lobby {
func (u *Usher) FindExistingPrivateLobby(p utils.Passphrase) *lobbies.Lobby {
lobby := lobbies.GetLobbyRegistry().GetLobbyByPassphrase(p)
if lobby.IsFull() {
if lobby == nil || lobby.IsFull() {
return nil
}
return lobby