adding a context null check

This commit is contained in:
tibbi 2023-07-26 21:36:45 +02:00
parent ab141cbaad
commit b984d98e52
1 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.fragment_clock.view.*
import java.util.*
import java.util.Calendar
class ClockFragment : Fragment() {
private val ONE_SECOND = 1000L
@ -111,8 +111,8 @@ class ClockFragment : Fragment() {
}
fun updateAlarm() {
view.apply {
requireContext().getClosestEnabledAlarmString { nextAlarm ->
context?.getClosestEnabledAlarmString { nextAlarm ->
view.apply {
clock_alarm.beVisibleIf(nextAlarm.isNotEmpty())
clock_alarm.text = nextAlarm
clock_alarm.colorCompoundDrawable(requireContext().getProperTextColor())