adding a null check
This commit is contained in:
parent
6da7faf383
commit
c05f5fccac
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue