Fix update worker crashing application

This commit is contained in:
NerdNumber9 2019-07-28 02:32:10 -04:00
parent 9ff8235de4
commit 39ffd3c3bc

View File

@ -225,7 +225,8 @@ class EHentaiUpdateWorker: JobService(), CoroutineScope {
}
suspend fun updateEntryAndGetChapters(manga: Manga): List<Chapter> {
val source = sourceManager.get(manga.source) as EHentai
val source = sourceManager.get(manga.source) as? EHentai
?: throw GalleryNotUpdatedException(false, IllegalStateException("Missing EH-based source (${manga.source})!"))
try {
val updatedManga = source.fetchMangaDetails(manga).toSingle().await(Schedulers.io())