]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash when opening new tab with search
authorAkseli Lahtinen <akselmo@akselmo.dev>
Fri, 28 Feb 2025 17:43:20 +0000 (17:43 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Fri, 28 Feb 2025 17:43:20 +0000 (17:43 +0000)
When new tab is opened and it has a search started,
it tries to set the location URL to a navigator that
is not yet necessarily assigned in memory: This is because the new tab is not active.

The locationUrl will be changed properly when tab is activated.

BUG:500101

src/dolphinviewcontainer.cpp

index 40df2bc7d894f14e7e1cac79926d3a90b801fb09..dcf159cda1fc4e9d01406bf9a7ead203d0c1ce2e 100644 (file)
@@ -942,7 +942,12 @@ void DolphinViewContainer::startSearching()
     const QUrl url = m_searchBox->urlForSearching();
     if (url.isValid() && !url.isEmpty()) {
         m_view->setViewPropertiesContext(QStringLiteral("search"));
-        m_urlNavigatorConnected->setLocationUrl(url);
+        // If we open a new tab that has a search assigned to it, we can't
+        // update the urlNavigator, since there is none connected to that tab.
+        // See BUG:500101
+        if (m_urlNavigatorConnected) {
+            m_urlNavigatorConnected->setLocationUrl(url);
+        }
     }
 }