From 406651e972a3d4eb91f0054d2a68f589b1eb2735 Mon Sep 17 00:00:00 2001 From: Martin Matilla Date: Mon, 27 Jan 2025 19:18:05 +0100 Subject: [PATCH] QEvent: Checking for valid device before accessing during formatTouchEvent --- src/gui/kernel/qevent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 5f4daced732..c1d209eb865 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3754,7 +3754,8 @@ static inline void formatTouchEvent(QDebug d, const QTouchEvent &t) { d << "QTouchEvent("; QtDebugUtils::formatQEnum(d, t.type()); - d << " device: " << t.device()->name(); + const auto* device = t.device(); + d << " device: " << device ? device->name() : "No device"; d << " states: "; QtDebugUtils::formatQFlags(d, t.touchPointStates()); d << ", " << t.points().size() << " points: " << t.points() << ')';