summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r--src/net/net.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp
index d6b6e2945..7f394bcc4 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -113,14 +113,18 @@ std::set<int> ignorePackets;
void connectToServer(const ServerInfo &server)
{
BLOCK_START("Net::connectToServer")
- if (networkType == server.type && (generalHandler != nullptr))
+ if (networkType == server.type &&
+ generalHandler != nullptr)
{
generalHandler->reload();
}
else
{
- if (networkType != ServerType::UNKNOWN && (generalHandler != nullptr))
+ if (networkType != ServerType::UNKNOWN &&
+ generalHandler != nullptr)
+ {
generalHandler->unload();
+ }
switch (server.type)
{
@@ -141,7 +145,8 @@ void connectToServer(const ServerInfo &server)
break;
}
- generalHandler->load();
+ if (generalHandler != nullptr)
+ generalHandler->load();
networkType = server.type;
}