From 42ddf685c1b31838acc00fc52358f4d7c6cfbe32 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Mon, 16 Nov 2015 20:57:23 +0530 Subject: [PATCH] [InputRedirection] Don't crash on invalid Toplevel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: Martin Gräßlin --- input.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/input.cpp b/input.cpp index b665808655..55898e1cfd 100644 --- a/input.cpp +++ b/input.cpp @@ -704,10 +704,12 @@ void InputRedirection::processPointerMotion(const QPointF &pos, uint32_t time) if (waylandServer()->isScreenLocked()) { Toplevel *t = findToplevel(pos.toPoint()); - if (auto seat = findSeat()) { - seat->setFocusedPointerSurface(t->surface(), t->pos()); - seat->setTimestamp(time); - seat->setPointerPos(pos); + if (t && t->surface()) { + if (auto seat = findSeat()) { + seat->setFocusedPointerSurface(t->surface(), t->pos()); + seat->setTimestamp(time); + seat->setPointerPos(pos); + } } return; }