diff --git a/src/Undo.cpp b/src/Undo.cpp index c0cf56925e..693008268a 100644 --- a/src/Undo.cpp +++ b/src/Undo.cpp @@ -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_; }