From 450687131047a666ca5540f47e0d0b80d29db774 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 30 Apr 2025 00:10:07 +0100 Subject: [PATCH] xdg-bell: avoid crashes on null toplevel --- src/protocols/XDGBell.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocols/XDGBell.cpp b/src/protocols/XDGBell.cpp index 61f070ff..593d78fc 100644 --- a/src/protocols/XDGBell.cpp +++ b/src/protocols/XDGBell.cpp @@ -12,6 +12,14 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UPsetOnDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); }); m_resource->setRing([](CXdgSystemBellV1* r, wl_resource* toplevel) { + if (!toplevel) { + g_pEventManager->postEvent(SHyprIPCEvent{ + .event = "bell", + .data = "", + }); + return; + } + auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel); if (!TOPLEVEL) {