From 113e95f15f86b2f800dbede419d5c4f28fd77d0a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 31 Oct 2025 18:49:58 +0000 Subject: Allow getting an I/O hook from a user I/O handler. --- modules/websocket.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/websocket.cpp') 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(item)); - if ((user) && (user->io->GetSocket()->GetModHook(this))) - ServerInstance->Users.QuitUser(user, "WebSocket module unloading"); + auto* user = IS_LOCAL(static_cast(item)); + if (!user || !user->io->GetModHook(this)) + return; + + ServerInstance->Users.QuitUser(user, "WebSocket module unloading"); } void OnWhois(Whois::Context& whois) override -- cgit v1.3.1-10-gc9f91