don't crash if initial loading was not successful

This commit is contained in:
Jannik 2020-12-30 14:18:04 +01:00
parent 7a5f90cb82
commit 9705a752fb
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
2 changed files with 11 additions and 9 deletions

View File

@ -121,7 +121,7 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
val time = measureTimeMillis {
Preferences.load(this)
// make sure credentials are set
// make sure credentials are set, run's async
EncryptedPreferences.readCredentials(this)
if (EncryptedPreferences.password.isEmpty()) {
showLoginDialog(true)

View File

@ -51,6 +51,7 @@ class HomeFragment : Fragment() {
}
private fun initHighlight() {
if (AoDParser.highlightsList.isNotEmpty()) {
highlightMedia = AoDParser.highlightsList[0]
binding.textHighlightTitle.text = highlightMedia.title
@ -63,6 +64,7 @@ class HomeFragment : Fragment() {
loadIntoCompoundDrawable(R.drawable.ic_baseline_add_24, binding.textHighlightMyList)
}
}
}
private fun initRecyclerViews() {
binding.recyclerMyList.addItemDecoration(MediaItemDecoration(9))