mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-14 20:26:50 +00:00
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:
parent
edd117f27a
commit
825bac4b43
@ -41,6 +41,9 @@ TocItem const & TocModel::tocItem(QModelIndex const & index) const
|
|||||||
|
|
||||||
QModelIndex TocModel::modelIndex(DocIterator const & dit) const
|
QModelIndex TocModel::modelIndex(DocIterator const & dit) const
|
||||||
{
|
{
|
||||||
|
if (toc_.empty())
|
||||||
|
return QModelIndex();
|
||||||
|
|
||||||
size_t const toc_index = toc_.item(dit) - toc_.begin();
|
size_t const toc_index = toc_.item(dit) - toc_.begin();
|
||||||
|
|
||||||
QModelIndexList list = match(index(0, 0), Qt::UserRole,
|
QModelIndexList list = match(index(0, 0), Qt::UserRole,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user