mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-12-11 20:15:10 +01:00
extra null checks on disconnect
This commit is contained in:
parent
820b57700c
commit
97a6c2f9b4
@ -50,6 +50,12 @@ public class SteamTransport : Transport
|
||||
|
||||
public override void ClientDisconnect()
|
||||
{
|
||||
// mirror seems to cause this sometimes
|
||||
if (_client == null)
|
||||
{
|
||||
OnClientError?.Invoke(TransportError.Unexpected, "tried to ClientDisconnect when client is null");
|
||||
return;
|
||||
}
|
||||
_client.Close();
|
||||
_client = null;
|
||||
}
|
||||
@ -78,6 +84,12 @@ public class SteamTransport : Transport
|
||||
|
||||
public override void ServerStop()
|
||||
{
|
||||
// mirror seems to cause this sometimes
|
||||
if (_server == null)
|
||||
{
|
||||
OnServerError?.Invoke(-1, TransportError.Unexpected, "tried to ServerStop when server is null");
|
||||
return;
|
||||
}
|
||||
_server.Close();
|
||||
_server = null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user