Skip to content

Commit 0886896

Browse files
committed
#3427 highlighting: add Q_ASSERT
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 67f0859 commit 0886896

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/helpers/qownnotesmarkdownhighlighter.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ QOwnNotesMarkdownHighlighter::QOwnNotesMarkdownHighlighter(QTextDocument *parent
4040
}
4141

4242
void QOwnNotesMarkdownHighlighter::updateCurrentNote(Note *note) {
43-
if (note != nullptr) {
44-
_currentNote = note;
45-
}
43+
Q_ASSERT(note);
4644

47-
_hasEncrypted = _currentNote ? _currentNote->hasEncryptedNoteText() : false;
45+
_currentNote = note;
46+
_hasEncrypted = _currentNote->hasEncryptedNoteText();
4847
_highlightEncrypted = false; // Reset state when note changes
4948
}
5049

0 commit comments

Comments
 (0)