Description
The KYC Level 1 screen can crash with a NullPointerException while confirming the date of birth selection.
In KYCLevel1Screen.kt, the confirm button directly uses a non-null assertion on dateState.selectedDateMillis:
onAction(KycLevel1Action.DobChanged(dateState.selectedDateMillis!!))
Although the button is enabled only when a date is selected, the enabled state and click handler access the state separately. During rapid taps, recomposition, or AnimatedVisibility transitions, selectedDateMillis may temporarily become null between these reads, resulting in a crash.
Location
feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1Screen.kt
Steps to Reproduce
- Navigate to the KYC Level 1 screen
- Open the date of birth picker
- Rapidly tap OK or interact with the picker during animation/recomposition
Expected Behavior
The selected date should be safely processed, or the action should be ignored if no valid date is available.
Actual Behavior
The application crashes with a NullPointerException caused by selectedDateMillis!!.
Platform
- Android
- Kotlin Multiplatform (affects all platforms using this composable)
Description
The KYC Level 1 screen can crash with a
NullPointerExceptionwhile confirming the date of birth selection.In
KYCLevel1Screen.kt, the confirm button directly uses a non-null assertion ondateState.selectedDateMillis:Although the button is enabled only when a date is selected, the enabled state and click handler access the state separately. During rapid taps, recomposition, or
AnimatedVisibilitytransitions,selectedDateMillismay temporarily becomenullbetween these reads, resulting in a crash.Location
feature/kyc/src/commonMain/kotlin/org/mifospay/feature/kyc/KYCLevel1Screen.ktSteps to Reproduce
Expected Behavior
The selected date should be safely processed, or the action should be ignored if no valid date is available.
Actual Behavior
The application crashes with a
NullPointerExceptioncaused byselectedDateMillis!!.Platform