mirror of
https://github.com/FossifyOrg/Notes.git
synced 2026-10-06 19:01:49 -04:00
fix: prevent crash when activity is finishing or destroyed (#218)
This commit is contained in:
1 parent
5691143a9a
commit
ee32280a13
1 file changed
+4
@@ -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