┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-04-16 21:27:39 +0000
committerPeter Penz <[email protected]>2008-04-16 21:27:39 +0000
commit50acc2d6ecbae2fb3c228bf779b23eabf3346cb1 (patch)
treeee8725a15aaa1106fcf7fbc582a9e98c0a0b3620
parent3a27f307993829fabfa34e89a8e794e8c5c4ebca (diff)
fix possible crash when selecting "New Tab" from the tab context menu of an inactive tab
svn path=/trunk/KDE/kdebase/apps/; revision=797843
-rw-r--r--src/dolphinmainwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 37fdce75b..b165e1cb3 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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) {