Fix crash when setting cover errors (closes #7714)

This commit is contained in:
arkon
2022-08-10 16:11:12 -04:00
parent 22e83f408b
commit e511f24979
8 changed files with 34 additions and 43 deletions

View File

@@ -80,15 +80,12 @@ suspend fun DomainManga.editCover(
stream: InputStream,
updateManga: UpdateManga = Injekt.get(),
coverCache: CoverCache = Injekt.get(),
): Boolean {
return if (isLocal()) {
) {
if (isLocal()) {
LocalSource.updateCover(context, toDbManga(), stream)
updateManga.awaitUpdateCoverLastModified(id)
} else if (favorite) {
coverCache.setCustomCoverToCache(toDbManga(), stream)
updateManga.awaitUpdateCoverLastModified(id)
} else {
// We should never reach this block
false
}
}