Avoid crashing if getChapterUrl is not implemented

Fixes #9105

(cherry picked from commit ceaf579cb0b4b0ecdf2e56f245a2fad2b6ed2e85)
This commit is contained in:
arkon 2023-02-18 10:16:17 -05:00 committed by Jobobby04
parent 268f542bbb
commit 366219d7f5

View File

@ -682,7 +682,12 @@ class ReaderViewModel(
val sChapter = getCurrentChapter()?.chapter ?: return null
val source = getSource() ?: return null
return source.getChapterUrl(sChapter)
return try {
source.getChapterUrl(sChapter)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
null
}
}
/**