[server] Do not try to create data offers without source

Summary: An internal drag is without data source. Still we tried to create offers.

Test Plan: This change makes the updated autotest in D15072 pass without errors.

Reviewers: #kwin, hein

Reviewed By: hein

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15074
This commit is contained in:
Roman Gilg 2018-08-25 12:58:02 +02:00
parent c9bac2d41d
commit a160143d57

View file

@ -159,6 +159,10 @@ DataOfferInterface *DataDeviceInterface::Private::createDataOffer(DataSourceInte
if (!resource) {
return nullptr;
}
if (!source) {
// a data offer can only exist together with a source
return nullptr;
}
Q_Q(DataDeviceInterface);
DataOfferInterface *offer = new DataOfferInterface(source, q, resource);
auto c = q->global()->display()->getConnection(wl_resource_get_client(resource));