diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index fda0b6353e..b83c740420 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -851,7 +851,13 @@ xcb_timestamp_t QXcbConnection::getTimestamp() xcb_window_t QXcbConnection::getSelectionOwner(xcb_atom_t atom) const { - return Q_XCB_REPLY(xcb_get_selection_owner, xcb_connection(), atom)->owner; + auto reply = Q_XCB_REPLY(xcb_get_selection_owner, xcb_connection(), atom); + if (!reply) { + qCDebug(lcQpaXcb) << "failed to query selection owner"; + return XCB_NONE; + } + + return reply->owner; } xcb_window_t QXcbConnection::getQtSelectionOwner() |