From 8896730d8bbbd84d2334dbf5d15aae9288262b1e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Nov 2020 17:26:21 +0100 Subject: [PATCH] catch exceptions thrown at fetching nomedia folders --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b99dff53f..723179bf8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.31.16' + implementation 'com.simplemobiletools:commons:5.31.17' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 852559934..91f579292 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -326,10 +326,11 @@ fun Context.getNoMediaFoldersSync(): ArrayList { val path = cursor.getStringValue(Files.FileColumns.DATA) ?: continue val noMediaFile = File(path) if (getDoesFilePathExist(noMediaFile.absolutePath, OTGPath) && noMediaFile.name == NOMEDIA) { - folders.add("${noMediaFile.parent}") + folders.add(noMediaFile.parent) } } while (cursor.moveToNext()) } + } catch (ignored: Exception) { } finally { cursor?.close() }