mirror of
https://github.com/FossifyOrg/Notes.git
synced 2025-12-23 23:59:34 -05:00
fix: prevent crash when activity is finishing or destroyed (#218)
This commit is contained in:
@@ -565,6 +565,10 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
private fun initViewPager(wantedNoteId: Long? = null) {
|
||||
NotesHelper(this).getNotes { notes ->
|
||||
if (isFinishing || isDestroyed) {
|
||||
return@getNotes
|
||||
}
|
||||
|
||||
notes.filter { it.shouldBeUnlocked(this) }
|
||||
.forEach(::removeProtection)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user