adding some try/catch blocks

This commit is contained in:
tibbi 2020-10-01 17:23:29 +02:00
parent 7e0ebaace9
commit 60b44c27be
2 changed files with 31 additions and 25 deletions

View file

@ -77,7 +77,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.30.17'
implementation 'com.simplemobiletools:commons:5.30.25'
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'

View file

@ -481,6 +481,7 @@ class MediaFetcher(val context: Context) {
val uri = Files.getContentUri("external")
try {
val cursor = context.contentResolver.query(uri, projection, null, null, null)
cursor?.use {
if (cursor.moveToFirst()) {
@ -496,6 +497,8 @@ class MediaFetcher(val context: Context) {
} while (cursor.moveToNext())
}
}
} catch (e: Exception) {
}
val dateTakenValues = context.dateTakensDB.getAllDateTakens()
@ -547,6 +550,7 @@ class MediaFetcher(val context: Context) {
val uri = Files.getContentUri("external")
try {
val cursor = context.contentResolver.query(uri, projection, null, null, null)
cursor?.use {
if (cursor.moveToFirst()) {
@ -562,6 +566,8 @@ class MediaFetcher(val context: Context) {
} while (cursor.moveToNext())
}
}
} catch (e: Exception) {
}
return lastModifieds
}