]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/global.cpp
Avoid crashing on startup if DBus isn't running
[dolphin.git] / src / global.cpp
index 197d6ec288f5e1b88ca0a9b3d129154293d4fbb3..d217a67ec82c71996d90b2f2b01636a88189380d 100644 (file)
@@ -120,7 +120,8 @@ QVector<QPair<QSharedPointer<OrgKdeDolphinMainWindowInterface>, QStringList>> Do
     }
 
     // Look for dolphin instances among all available dbus services.
-    const QStringList dbusServices = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
+    QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface();
+    const QStringList dbusServices = sessionInterface ? sessionInterface->registeredServiceNames().value() : QStringList();
     // Don't match the service without trailing "-" (unique instance)
     const QString pattern = QStringLiteral("org.kde.dolphin-");
     // Don't match the pid without leading "-"