Blob Blame History Raw
From 8d673fe2edebe2c5bf338a779ef22ae212dc244a Mon Sep 17 00:00:00 2001
From: Paul Olav Tvete <paul.tvete@qt.io>
Date: Tue, 14 Sep 2021 11:56:23 +0200
Subject: [PATCH 18/40] Wayland client: Fix crash when windows are shown/hidden
 during drag

Fixes: QTBUG-87624
Pick-to: 6.2 5.15
Change-Id: I1b9443df091878abcd4fbe9c55927cb819aebd59
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit c64c5d3849b40617e1de0295f8690f354cab2b3a)
---
 src/client/qwaylanddatadevice.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
index 54a69c3c..bbd2d568 100644
--- a/src/client/qwaylanddatadevice.cpp
+++ b/src/client/qwaylanddatadevice.cpp
@@ -169,7 +169,7 @@ void QWaylandDataDevice::data_device_drop()
 
 void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, wl_fixed_t x, wl_fixed_t y, wl_data_offer *id)
 {
-    auto *dragWaylandWindow = QWaylandWindow::fromWlSurface(surface);
+    auto *dragWaylandWindow = surface ? QWaylandWindow::fromWlSurface(surface) : nullptr;
     if (!dragWaylandWindow)
         return; // Ignore foreign surfaces
 
-- 
2.35.1