mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Prevent Outliner crash due to emptied toc value
This might need a more profound fix in the long term, see https://marc.info/?l=lyx-devel&m=163588729224679&w=2
This commit is contained in:
parent
5eecfa3e04
commit
31146ae8d3
@ -327,6 +327,11 @@ TocItem const TocModels::currentItem(QString const & type,
|
||||
}
|
||||
LASSERT(index.model() == it.value()->model(), return TocItem());
|
||||
|
||||
if (it.value()->empty()) {
|
||||
LYXERR(Debug::GUI, "TocModels::currentItem(): requested toc is empty!");
|
||||
return TocItem();
|
||||
}
|
||||
|
||||
return it.value()->tocItem(index);
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,8 @@ public:
|
||||
///
|
||||
void clear();
|
||||
///
|
||||
bool empty() { return toc_->empty(); }
|
||||
///
|
||||
QAbstractItemModel * model();
|
||||
///
|
||||
QAbstractItemModel const * model() const;
|
||||
|
Loading…
Reference in New Issue
Block a user