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; }