Fix crash on new document.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25237 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-12 15:43:31 +00:00
parent edd117f27a
commit 825bac4b43

View File

@ -41,6 +41,9 @@ TocItem const & TocModel::tocItem(QModelIndex const & index) const
QModelIndex TocModel::modelIndex(DocIterator const & dit) const
{
if (toc_.empty())
return QModelIndex();
size_t const toc_index = toc_.item(dit) - toc_.begin();
QModelIndexList list = match(index(0, 0), Qt::UserRole,