Fixup c7496a11: test emptiness before accessing elements

This commit is contained in:
Jean-Marc Lasgouttes 2018-06-01 21:48:26 +02:00
parent 2fbce44401
commit 4d0c43f9aa

View File

@ -612,7 +612,9 @@ void Undo::endUndoGroup(CursorData const & cur_after)
bool Undo::activeUndoGroup() const
{
return d->group_level_ > 0 && d->undostack_.top().group_id == d->group_id_;
return d->group_level_ > 0
&& !d->undostack_.empty()
&& d->undostack_.top().group_id == d->group_id_;
}