adding some try/catch blocks
This commit is contained in:
parent
7e0ebaace9
commit
60b44c27be
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue