mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
properly catch exceptions thrown in the background
This commit is contained in:
parent
7605e90632
commit
150aace3ca
1 changed files with 5 additions and 5 deletions
|
@ -872,12 +872,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
||||||
mLatestMediaDateId = getLatestMediaByDateId()
|
mLatestMediaDateId = getLatestMediaByDateId()
|
||||||
if (!isFromCache) {
|
if (!isFromCache) {
|
||||||
val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium }
|
val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium }
|
||||||
try {
|
|
||||||
Thread {
|
Thread {
|
||||||
|
try {
|
||||||
mediaDB.insertAll(mediaToInsert)
|
mediaDB.insertAll(mediaToInsert)
|
||||||
}.start()
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue