aboutsummaryrefslogtreecommitdiffstats
path: root/modules/websocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/websocket.cpp')
-rw-r--r--modules/websocket.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/websocket.cpp b/modules/websocket.cpp
index 2538b0451..bfec7673d 100644
--- a/modules/websocket.cpp
+++ b/modules/websocket.cpp
@@ -753,9 +753,11 @@ public:
if (type != ExtensionType::USER)
return;
- LocalUser* user = IS_LOCAL(static_cast<User*>(item));
- if ((user) && (user->io->GetSocket()->GetModHook(this)))
- ServerInstance->Users.QuitUser(user, "WebSocket module unloading");
+ auto* user = IS_LOCAL(static_cast<User*>(item));
+ if (!user || !user->io->GetModHook(this))
+ return;
+
+ ServerInstance->Users.QuitUser(user, "WebSocket module unloading");
}
void OnWhois(Whois::Context& whois) override