diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 7f44272bc339dd52aa81f4aff26fa94b9a8578b4..34b3da7df383a4d6375e1cb47e238d3d8a01c14c 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -208,7 +208,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::Bu data.suspendedDelivery = suspendedDelivery; emit connectionRequested(&data); - if (suspendedDelivery) { + if (suspendedDelivery && data.result->connection) { data.result->ref.ref(); QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(data.result); QTimer::singleShot(0, o, SLOT(execute())); @@ -291,7 +291,7 @@ void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::Co // will lock in QDBusConnectionPrivate::connectRelay() d->setConnection(c, error); d->createBusService(); - if (data->suspendedDelivery) + if (c && data->suspendedDelivery) d->setDispatchEnabled(false); } }