[plugins/qpa] Safety checks in native interface

During startup it might happen that the QPA is already loaded, but
the wayland server and it's internal connection not yet fully
created. Thus safety check for it.
This commit is contained in:
Martin Gräßlin 2015-12-18 15:27:47 +01:00
parent 20a9a2a247
commit 6c746764b4

View file

@ -48,6 +48,9 @@ void *NativeInterface::nativeResourceForIntegration(const QByteArray &resource)
{
const QByteArray r = resource.toLower();
if (r == s_displayKey || r == s_wlDisplayKey) {
if (!waylandServer() || !waylandServer()->internalClientConection()) {
return nullptr;
}
return waylandServer()->internalClientConection()->display();
}
if (r == s_compositorKey) {
@ -60,6 +63,9 @@ void *NativeInterface::nativeResourceForWindow(const QByteArray &resource, QWind
{
const QByteArray r = resource.toLower();
if (r == s_displayKey || r == s_wlDisplayKey) {
if (!waylandServer() || !waylandServer()->internalClientConection()) {
return nullptr;
}
return waylandServer()->internalClientConection()->display();
}
if (r == s_compositorKey) {