From 503da545fcb92ed2afda1cf4afdcdc80611790a0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 27 Oct 2019 10:52:34 +0100 Subject: [PATCH] adding some crashfixes --- .../gallery/pro/activities/MediaActivity.kt | 2 +- .../gallery/pro/adapters/DirectoryAdapter.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 92579a091..049bdd2d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -604,8 +604,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { ensureBackgroundThread { val oldMedia = mMedia.clone() as ArrayList val newMedia = it - gotMedia(newMedia, false) try { + gotMedia(newMedia, false) oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.filter { !File(it.path).exists() }.forEach { mMediumDao.deleteMediumPath(it.path) } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index 538b3ecb8..87c97c00b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -193,8 +193,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList