summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2010-10-13 09:58:21 (GMT)
committerkh1 <qt-info@nokia.com>2010-10-13 09:58:21 (GMT)
commit378b1608e7962da9ee295101be40c84606a8a6c0 (patch)
treea2531fa26bd6305cbb2e4bc1186ef73c3e4b62fb /tools
parentf2759b6b670632bde2ca5ecfa424c02a7c231e89 (diff)
downloadQt-378b1608e7962da9ee295101be40c84606a8a6c0.zip
Qt-378b1608e7962da9ee295101be40c84606a8a6c0.tar.gz
Qt-378b1608e7962da9ee295101be40c84606a8a6c0.tar.bz2
Fix potential crash in case we had opened pages but run now without docs.
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/openpagesmanager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/assistant/tools/assistant/openpagesmanager.cpp b/tools/assistant/tools/assistant/openpagesmanager.cpp
index 3b69b50..75b8653 100644
--- a/tools/assistant/tools/assistant/openpagesmanager.cpp
+++ b/tools/assistant/tools/assistant/openpagesmanager.cpp
@@ -167,7 +167,8 @@ void OpenPagesManager::setupInitialPages(bool defaultCollection,
m_model->addPage(helpEngine.homePage());
for (int i = 0; i < m_model->rowCount(); ++i)
CentralWidget::instance()->addPage(m_model->pageAt(i));
- setCurrentPage(initialPage);
+ setCurrentPage((initialPage >= m_model->rowCount())
+ ? m_model->rowCount() - 1 : initialPage);
m_openPagesSwitcher->selectCurrentPage();
}