Fix crash on updating trackers after reading with no network (closes #4207)
Cette révision appartient à :
Parent
8135136c86
révision
3df98d576e
1 fichiers modifiés avec 6 ajouts et 2 suppressions
|
@ -673,14 +673,18 @@ class ReaderPresenter(
|
||||||
// We want these to execute even if the presenter is destroyed and leaks
|
// We want these to execute even if the presenter is destroyed and leaks
|
||||||
// for a while. The view can still be garbage collected.
|
// for a while. The view can still be garbage collected.
|
||||||
async {
|
async {
|
||||||
service.update(track)
|
runCatching {
|
||||||
db.insertTrack(track).await()
|
service.update(track)
|
||||||
|
db.insertTrack(track).await()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.awaitAll()
|
.awaitAll()
|
||||||
|
.filter { it.isFailure }
|
||||||
|
.forEach { it.exceptionOrNull()?.let { e -> Timber.w(e) } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Référencer dans un nouveau ticket