From 4d9a0d2306a644f8670037ffe113dc9c430fc7b4 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 21 Jun 2023 12:39:15 +0200 Subject: [PATCH] input: don't crash if the internal handle is nullptr Pointer focus can stay on a closed tooltip while focus updates are blocked, so this needs to be checked for BUG: 471285 --- src/input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input.cpp b/src/input.cpp index 9ee2faaf6a..ee7cc3223c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1195,6 +1195,10 @@ class InternalWindowEventFilter : public InputEventFilter return false; } QWindow *internal = static_cast(input()->pointer()->focus())->handle(); + if (!internal) { + // the handle can be nullptr if the tooltip gets closed while focus updates are blocked + return false; + } QMouseEvent mouseEvent(event->type(), event->pos() - internal->position(), event->globalPosition(),