properly catch exceptions thrown in the background

This commit is contained in:
tibbi 2020-05-29 21:25:41 +02:00
parent 7605e90632
commit 150aace3ca

View file

@ -872,12 +872,12 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
mLatestMediaDateId = getLatestMediaByDateId()
if (!isFromCache) {
val mediaToInsert = (mMedia).filter { it is Medium && it.deletedTS == 0L }.map { it as Medium }
try {
Thread {
Thread {
try {
mediaDB.insertAll(mediaToInsert)
}.start()
} catch (e: Exception) {
}
} catch (e: Exception) {
}
}.start()
}
}