]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fix possible crash when selecting "New Tab" from the tab context menu of an inactive tab
authorPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 21:27:39 +0000 (21:27 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 16 Apr 2008 21:27:39 +0000 (21:27 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=797843

src/dolphinmainwindow.cpp

index 37fdce75b6fc1d6d224efc39c7ca2d2fd5b2228d..b165e1cb30d038892a03f6eeffaf4dd73d0b35aa 100644 (file)
@@ -753,8 +753,9 @@ void DolphinMainWindow::openTabContextMenu(int index, const QPoint& pos)
     QAction* selectedAction = menu.exec(pos);
     if (selectedAction == newTabAction) {
         const ViewTab& tab = m_viewTab[index];
-        const KUrl url = tab.primaryView->isActive() ? tab.primaryView->url() :
-                                                       tab.secondaryView->url();
+        Q_ASSERT(tab.primaryView != 0);
+        const KUrl url = (tab.secondaryView != 0) && tab.secondaryView->isActive() ?
+                         tab.secondaryView->url() : tab.primaryView->url();
         openNewTab(url);
         m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
     } else if (selectedAction == closeOtherTabsAction) {