double error and crash fix
This commit is contained in:
parent
5a482d8307
commit
cd3aad1c33
2 changed files with 5 additions and 1 deletions
|
@ -245,7 +245,7 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
binding.urlSize.visibility = if (video.size != null) View.VISIBLE else View.GONE
|
||||
binding.urlSize.text =
|
||||
// if video size is null or 0, show "Unknown Size" else show the size in MB
|
||||
(if (video.extraNote != null) " : " else "") + (if (video.size == 0) "Unknown Size" else (DecimalFormat("#.##").format(video.size ?: 0).toString()+ " MB"))
|
||||
(if (video.extraNote != null) " : " else "") + (if (video.size == 0.0) "Unknown Size" else (DecimalFormat("#.##").format(video.size ?: 0).toString()+ " MB"))
|
||||
}
|
||||
else {
|
||||
binding.urlQuality.text = "Multi Quality"
|
||||
|
|
|
@ -215,6 +215,10 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
logError(e)
|
||||
}
|
||||
}
|
||||
//check that index is not out of bounds (crash fix)
|
||||
if (media.selected!!.sourceIndex >= model.mangaReadSources!!.names.size) {
|
||||
media.selected!!.sourceIndex = 0
|
||||
}
|
||||
binding.mangaReaderSource.text = model.mangaReadSources!!.names[media.selected!!.sourceIndex]
|
||||
|
||||
binding.mangaReaderTitle.text = media.userPreferredName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue