diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt index 210cfdb4..0c2d2de2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt @@ -62,16 +62,15 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener { // checklist title can be null only because of the glitch in upgrade to 6.6.0, remove this check in the future items = items.filter { it.title != null }.toMutableList() as ArrayList + val sorting = config?.sorting ?: 0 + if (sorting and SORT_BY_CUSTOM == 0 && config?.moveDoneChecklistItems == true) { + items.sortBy { it.isDone } + } + + setupFragment() } catch (e: Exception) { migrateCheckListOnFailure(storedNote) } - - val sorting = config?.sorting ?: 0 - if (sorting and SORT_BY_CUSTOM == 0 && config?.moveDoneChecklistItems == true) { - items.sortBy { it.isDone } - } - - setupFragment() } } }