diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt index 3ecbf0a7..a1f3cb45 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt @@ -39,14 +39,14 @@ class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) { } fun updateClockTabAlarm() { - (fragments[TAB_CLOCK] as ClockFragment).updateAlarm() + (fragments[TAB_CLOCK] as? ClockFragment)?.updateAlarm() } fun updateAlarmTabAlarmSound(alarmSound: AlarmSound) { - (fragments[TAB_ALARM] as AlarmFragment).updateAlarmSound(alarmSound) + (fragments[TAB_ALARM] as? AlarmFragment)?.updateAlarmSound(alarmSound) } fun updateTimerTabAlarmSound(alarmSound: AlarmSound) { - (fragments[TAB_TIMER] as TimerFragment).updateAlarmSound(alarmSound) + (fragments[TAB_TIMER] as? TimerFragment)?.updateAlarmSound(alarmSound) } }