summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@theqtcompany.com>2016-03-18 17:01:31 +0100
committerJohan Helsing <johan.helsing@theqtcompany.com>2016-03-19 12:58:29 +0000
commitc64c17a5df40924a12950be3d584d82f311c3de2 (patch)
treebb5a1f6824632ab9dfa26a89fe9765fa113bc44d
parent2aac4c81eac8bb2c35362fce04cd2212edfe31e1 (diff)
Fix crash in qwindow-compositor when setting hidden cursor
Clients can request null as the cursor surface in order to hide the cursor. Added a null pointer check so it doesn't crash. Change-Id: I9a0081ea9edd74c504bd55e385a6854024ab0c8a Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp
index fbb687172..46416f0de 100644
--- a/examples/wayland/qwindow-compositor/windowcompositor.cpp
+++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp
@@ -256,7 +256,7 @@ void WindowCompositor::adjustCursorSurface(QWaylandSurface *surface, int hotspot
m_cursorHotspotX = hotspotX;
m_cursorHotspotY = hotspotY;
- if (surface->isMapped())
+ if (surface && surface->isMapped())
updateCursor();
}