From 50acc2d6ecbae2fb3c228bf779b23eabf3346cb1 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 16 Apr 2008 21:27:39 +0000 Subject: [PATCH] fix possible crash when selecting "New Tab" from the tab context menu of an inactive tab svn path=/trunk/KDE/kdebase/apps/; revision=797843 --- src/dolphinmainwindow.cpp | 5 +++-- 1 file 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) { -- 2.47.3