Skip to content

Commit

Permalink
datadevice: guard XWayland server against crashes
Browse files Browse the repository at this point in the history
The server might be dead or restarting, and we'd deref null

ref #7822
  • Loading branch information
vaxerski committed Jan 6, 2025
1 parent f390f48 commit f1a7a74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/protocols/core/DataDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void CWLDataDeviceProtocol::destroyResource(CWLDataOfferResource* resource) {

SP<IDataDevice> CWLDataDeviceProtocol::dataDeviceForClient(wl_client* c) {
#ifndef NO_XWAYLAND
if (c == g_pXWayland->pServer->xwaylandClient)
if (g_pXWayland->pServer && c == g_pXWayland->pServer->xwaylandClient)
return g_pXWayland->pWM->getDataDevice();
#endif

Expand Down

0 comments on commit f1a7a74

Please sign in to comment.