From 556b4acecabdd6d2182429bb026bb7151cc54cc4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 8 Mar 2022 18:51:33 +0100 Subject: [PATCH] adding a null check at text fragment --- .../com/simplemobiletools/notes/pro/fragments/TextFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt index 93bf2111..0c216dd7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/TextFragment.kt @@ -210,7 +210,7 @@ class TextFragment : NoteFragment() { } } - fun hasUnsavedChanges() = getCurrentNoteViewText() != note!!.getNoteStoredValue(requireContext()) + fun hasUnsavedChanges() = note != null && getCurrentNoteViewText() != note!!.getNoteStoredValue(requireContext()) fun focusEditText() { view.text_note_view.requestFocus()