Skip to content

Commit 58ded92

Browse files
committed
check if the activity is alive when getting items
1 parent 50ca0ae commit 58ded92

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
162162

163163
private fun getItems(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
164164
Thread {
165+
if (activity?.isActivityDestroyed() == true) {
166+
return@Thread
167+
}
168+
165169
if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
166170
getRegularItemsOf(path, callback)
167171
} else {

0 commit comments

Comments
 (0)