Fix crash on updating trackers after reading with no network (closes #4207)
(cherry picked from commit 3df98d576ebfc183a50b6c458f655a8d272c4b7a)
This commit is contained in:
parent
73092a2832
commit
9085c142d5
@ -787,14 +787,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) } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user