avoid fetching files at a destroyed MainActivity

This commit is contained in:
tibbi 2020-02-07 20:18:06 +01:00
parent 0cfcba6c8f
commit 02bc49a259

View file

@ -899,7 +899,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
try { try {
for (directory in dirs) { for (directory in dirs) {
if (mShouldStopFetching) { if (mShouldStopFetching || isDestroyed || isFinishing) {
return return
} }
@ -972,7 +972,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
// check the remaining folders which were not cached at all yet // check the remaining folders which were not cached at all yet
for (folder in foldersToScan) { for (folder in foldersToScan) {
if (mShouldStopFetching) { if (mShouldStopFetching || isDestroyed || isFinishing) {
return return
} }