diff --git a/x11eventfilter.cpp b/x11eventfilter.cpp index 0521e23a11..4f7839b94a 100644 --- a/x11eventfilter.cpp +++ b/x11eventfilter.cpp @@ -32,7 +32,9 @@ X11EventFilter::X11EventFilter(int eventType, int opcode, int genericEventType) X11EventFilter::~X11EventFilter() { - Workspace::self()->unregisterEventFilter(this); + if (auto w = Workspace::self()) { + w->unregisterEventFilter(this); + } } }