[server] Add resource check in QtExtendedSurfaceInterface::close

Summary:
The QtExtendedSurfaceInterface might be unbound and thus the resource
might be null when calling into close. Thus we need to do a nullptr
check.

Hit a crash there.

Test Plan:
Unfortunately no test case as we don't have a client side
implementation for this.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1961
This commit is contained in:
Martin Gräßlin 2016-06-20 16:25:15 +02:00
parent 262b49d713
commit 3f69ab1bf0

View file

@ -219,6 +219,9 @@ QtExtendedSurfaceInterface::Private *QtExtendedSurfaceInterface::d_func() const
void QtExtendedSurfaceInterface::close()
{
Q_D();
if (!d->resource) {
return;
}
qt_extended_surface_send_close(d->resource);
d->client->flush();
}