Fix crash when qt compiled with dbus support and no dbus interface.
Add check if interface exists before calling it. Change-Id: I86762fd9b82131d12aac0281c86eca549752fdbd Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
parent
c52c8e5e1e
commit
cbb918753c
@ -79,10 +79,14 @@ QNetworkManagerEngine::QNetworkManagerEngine(QObject *parent)
|
||||
connect(ofonoWatcher, SIGNAL(serviceUnregistered(QString)),
|
||||
this, SLOT(ofonoUnRegistered(QString)));
|
||||
|
||||
if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.ofono"))
|
||||
QDBusConnectionInterface *interface = QDBusConnection::systemBus().interface();
|
||||
|
||||
if (!interface) return;
|
||||
|
||||
if (interface->isServiceRegistered("org.ofono"))
|
||||
QMetaObject::invokeMethod(this, "ofonoRegistered", Qt::QueuedConnection);
|
||||
|
||||
if (QDBusConnection::systemBus().interface()->isServiceRegistered(NM_DBUS_SERVICE))
|
||||
if (interface->isServiceRegistered(NM_DBUS_SERVICE))
|
||||
QMetaObject::invokeMethod(this, "nmRegistered", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user