summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-02-18 16:15:32 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-04-16 13:01:45 +0000
commitcbb918753c493959a53e7e62db62007d3e4ffb4b (patch)
tree948cc1015be2b7d273dfee21d9b80e8eb541e08b
parentc52c8e5e1e3482e144279d8f85df06f6c3597041 (diff)
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>
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index 843387e679..e662d5f2d3 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -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);
}