mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-24 01:48:24 +01:00
Fix crash on updating trackers after reading with no network (closes #4207)
This commit is contained in:
parent
8135136c86
commit
3df98d576e
@ -673,14 +673,18 @@ class ReaderPresenter(
|
||||
// We want these to execute even if the presenter is destroyed and leaks
|
||||
// for a while. The view can still be garbage collected.
|
||||
async {
|
||||
service.update(track)
|
||||
db.insertTrack(track).await()
|
||||
runCatching {
|
||||
service.update(track)
|
||||
db.insertTrack(track).await()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
.awaitAll()
|
||||
.filter { it.isFailure }
|
||||
.forEach { it.exceptionOrNull()?.let { e -> Timber.w(e) } }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user