Skip to content

Commit

Permalink
#2716: Fix a possible crash with restoring from the note history
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Jan 30, 2023
1 parent 951bba4 commit 7454005
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# QOwnNotes Changelog

## 23.1.5
- a possible crash with the note history was fixed (for [#2716](https://github.com/pbek/QOwnNotes/issues/2716))

## 23.1.4
- the obsolete (because of re-implementation of all XML parsing parts in QOwnNotes)
Qt module `xmlpatterns` was now removed from all build process to save disk space
Expand Down
6 changes: 4 additions & 2 deletions src/entities/notehistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ void NoteHistory::restoreForCurrentNoteFolder() {
currentIndex = newCurrentIndex;
}

// also set the current history item so it can be use to restore the current
// also set the current history item, so it can be used to restore the current
// note after switching note folders
currentHistoryItem = noteHistory->at(currentIndex);
if (noteHistory->count() > currentIndex) {
currentHistoryItem = noteHistory->at(currentIndex);
}
}

QDebug operator<<(QDebug dbg, const NoteHistory &history) {
Expand Down

0 comments on commit 7454005

Please sign in to comment.