adding a null check

This commit is contained in:
tibbi 2020-07-12 22:03:07 +02:00
parent 6da7faf383
commit c05f5fccac
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
fun textColorChanged(color: Int) {
when {
this is GroupsFragment -> (fragment_list.adapter as GroupsAdapter).updateTextColor(color)
else -> (fragment_list.adapter as ContactsAdapter).apply {
else -> (fragment_list.adapter as? ContactsAdapter)?.apply {
updateTextColor(color)
}
}