aboutsummaryrefslogtreecommitdiff
path: root/modules/websocket.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-10-31 18:49:58 +0000
committerGravatar Sadie Powell2025-10-31 18:49:58 +0000
commit113e95f15f86b2f800dbede419d5c4f28fd77d0a (patch)
tree450d44cc0d8c374330ca3f71ed20939c666ad23f /modules/websocket.cpp
parentReduce nesting in OnCleanup hooks. (diff)
Allow getting an I/O hook from a user I/O handler.
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