diff options
| author | Alex Richardson <[email protected]> | 2021-07-09 09:30:58 +0100 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2021-07-10 20:18:28 +0000 |
| commit | 531de16cd0703882e8972bba60c9f295c2d81277 (patch) | |
| tree | 528415ea2cc50d4318938888d295b603b78f70f8 /src/dolphinmainwindow.cpp | |
| parent | d284e22f8730e98336fab515a339143341f55ec1 (diff) | |
Avoid crashing on startup if DBus isn't running
I am trying to run Dolphin on a minimal FreeBSD CHERI-RISC-V QEMU
instance and I haven't got DBus running. Without this change, I get
crashes because QDBusConnection::sessionBus().interface() returns NULL
if DBus isn't running.
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index fe39d4d2f..d4c8199a6 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1543,7 +1543,8 @@ void DolphinMainWindow::setupActions() stashSplit->setToolTip(i18nc("@info", "Opens the stash virtual directory in a split window")); stashSplit->setIcon(QIcon::fromTheme(QStringLiteral("folder-stash"))); stashSplit->setCheckable(false); - stashSplit->setVisible(QDBusConnection::sessionBus().interface()->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier"))); + QDBusConnectionInterface *sessionInterface = QDBusConnection::sessionBus().interface(); + stashSplit->setVisible(sessionInterface && sessionInterface->isServiceRegistered(QStringLiteral("org.kde.kio.StashNotifier"))); connect(stashSplit, &QAction::triggered, this, &DolphinMainWindow::toggleSplitStash); KStandardAction::redisplay(this, &DolphinMainWindow::reloadView, actionCollection()); |
