summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/users.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 361b7ba21..95ae87f5d 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -314,8 +314,11 @@ char* User::MakeHostIP()
void User::CloseSocket()
{
- ServerInstance->SE->Shutdown(this, 2);
- ServerInstance->SE->Close(this);
+ if (this > -1)
+ {
+ ServerInstance->SE->Shutdown(this, 2);
+ ServerInstance->SE->Close(this);
+ }
}
char* User::GetFullHost()