Handle null peer on disconnect

parent 3848fe32
......@@ -74,7 +74,8 @@ bool GameClient::connect(enet_uint32 hostAddress, enet_uint16 port)
void GameClient::disconnect()
{
enet_peer_disconnect (peer, 0);
if(peer != nullptr)
enet_peer_disconnect (peer, 0);
}
void GameClient::sendPacket(const std::string& packet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment