Commit 163cd4e8 authored by Jonathan Michalon's avatar Jonathan Michalon

Add few null-checks when disconnecting

parent 3759a85a
......@@ -111,9 +111,13 @@ namespace OVCCClient
throws ServerError
{
sigqueue.remove_all ();
game.abort();
server.disconnect_from ();
if (game != null) {
game.abort ();
}
if (server.is_connected()) {
Please register or sign in to reply
server.disconnect_from ();
}
/* destroy server */
server = null;
game = null;
......
......@@ -56,7 +56,10 @@ public class Client: Object
requires (connection != null)
{
signal_handle = null; /* to break circular reference */
game.remove_player (player);
if (game != null) {
game.remove_player (player);
}
return connection.socket.close ();
}
......
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