Fix nil pointer dereference.
This commit is contained in:
parent
a3e6ab31c3
commit
a93b1a1aca
@ -34,7 +34,7 @@ func (u *Usher) CreateNewPrivateLobby(player *chess.Player) *lobbies.Lobby {
|
|||||||
|
|
||||||
func (u *Usher) FindExistingPrivateLobby(p utils.Passphrase) *lobbies.Lobby {
|
func (u *Usher) FindExistingPrivateLobby(p utils.Passphrase) *lobbies.Lobby {
|
||||||
lobby := lobbies.GetLobbyRegistry().GetLobbyByPassphrase(p)
|
lobby := lobbies.GetLobbyRegistry().GetLobbyByPassphrase(p)
|
||||||
if lobby.IsFull() {
|
if lobby == nil || lobby.IsFull() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return lobby
|
return lobby
|
||||||
|
Loading…
Reference in New Issue
Block a user