diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 7e75bc0b7..f04462378 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -718,7 +718,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } } } - } catch (ignored: ConcurrentModificationException) { + } catch (ignored: Exception) { } val foldersToScan = mediaFetcher.getFoldersToScan() @@ -776,7 +776,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { sortedDirs = sortedDirs.distinctBy { it.path.getDistinctPath() } as ArrayList runOnUiThread { - (directories_grid.adapter as DirectoryAdapter).updateDirs(sortedDirs) + (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(sortedDirs) } }