]> cloud.milkyroute.net Git - dolphin.git/commitdiff
don't crash when building without baloo
authorHarald Sitter <sitter@kde.org>
Wed, 20 Jan 2021 14:29:04 +0000 (15:29 +0100)
committerHarald Sitter <sitter@kde.org>
Mon, 25 Jan 2021 09:12:53 +0000 (10:12 +0100)
show_information_panel is only created when building with baloo. only
access it when built with baloo, otherwise always report the panel as
off.

this fixes a nullptr deref because action() would return a nullptr since
show_information_panel isn't a thing in all build configurations

(full disclosure: I can't reproduce the crash, nor did I build without
baloo)

BUG: 431730

src/dolphinmainwindow.cpp

index 5a531938325f52c7534e483dae42915c6dea3745..71d3ca03339f405c9b874d684c0e0d5aa2263576 100644 (file)
@@ -258,7 +258,11 @@ bool DolphinMainWindow::isFoldersPanelEnabled() const
 
 bool DolphinMainWindow::isInformationPanelEnabled() const
 {
 
 bool DolphinMainWindow::isInformationPanelEnabled() const
 {
+#ifdef HAVE_BALOO
     return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
     return actionCollection()->action(QStringLiteral("show_information_panel"))->isChecked();
+#else
+    return false;
+#endif
 }
 
 void DolphinMainWindow::openFiles(const QStringList& files, bool splitView)
 }
 
 void DolphinMainWindow::openFiles(const QStringList& files, bool splitView)