From ff6ddee79b67f756477f08cd7793b0e26bbe71d9 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 20 Apr 2008 18:03:08 +0000 Subject: Since the connection objects might not have been created yet when an exception is thrown, check them for 0 before calling disconnect on them. --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 4aadbb74..9ac4b9a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1120,9 +1120,12 @@ int main(int argc, char *argv[]) logger->log("Exception"); } - accountServerConnection->disconnect(); - gameServerConnection->disconnect(); - chatServerConnection->disconnect(); + if (accountServerConnection) + accountServerConnection->disconnect(); + if (gameServerConnection) + gameServerConnection->disconnect(); + if (chatServerConnection) + chatServerConnection->disconnect(); delete accountServerConnection; delete gameServerConnection; -- cgit v1.2.3-60-g2f50