Skip to content
Snippets Groups Projects
Commit a1ffefa0 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Prevent crash on race condition

Fixes #3083
parent 196ab52f
No related branches found
No related tags found
1 merge request!1973Crash fixes
Pipeline #512293 passed with stage
in 7 minutes and 26 seconds
......@@ -162,9 +162,10 @@ open class BrowserModel(
suspend fun updateMediaPlayed(mw: MediaWrapper) = withContext(Dispatchers.IO) {
if (dataset.getList().contains(mw)) {
val item = provider.medialibrary.getMedia(mw.id)
withContext(Dispatchers.Main) {
dataset.replace(item)
provider.medialibrary.getMedia(mw.id)?.let { item ->
withContext(Dispatchers.Main) {
dataset.replace(item)
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment