Fix crash when opening the MangaController from... (#5419)

...the browse search
null safe cast to TextView because when searching for manga in a source,
the toolbar has no children and
find() returns null.

(cherry picked from commit ac6b4235b9293c032ad9a290347e0e2ded0a36b8)
This commit is contained in:
jmir1 2021-06-19 01:46:45 +02:00 committed by Jobobby04
parent 4706493057
commit 9e38b5231c

View File

@ -399,7 +399,7 @@ class MangaController :
val scrolledList = binding.fullRecycler ?: binding.infoRecycler!!
if (toolbarTextView == null) {
toolbarTextView = (activity as? MainActivity)?.binding?.toolbar?.children
?.find { it is TextView } as TextView
?.find { it is TextView } as? TextView
}
toolbarTextView?.alpha = when {
// Specific alpha provided