Missing input validation on participant registration causes SQLite constraint crash #2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
NewParticipantScreen.kt, the "Register Participant" button invokesonRegisterwithout validating that mandatory fields have been completed:Issues Found:
form.genderis"". SQLite throwsSQLiteConstraintException: CHECK constraint failed, which is unhandled and crashes the application.-1is passed into foreign key columns.NewParticipantScreen.ktonly provideslistOf("Male", "Female"), omitting"Other"which is allowed by the database constraint.cityandaccentcan be submitted as blank strings.Suggested Fix
NewParticipantScreento ensuredob,gender,denominationId,educationalLevelId,city, andaccentare non-empty before enabling the button or submitting."Other"in the gender dropdown options.SQLiteExceptioninParticipantRepositoryto display a user-friendly error message rather than crashing.