Navigation crashes when question contains slashes ('/') or special characters #1
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
MainActivity.kt, the navigation route fromNewRecordScreentoNewParticipantScreenis defined as:and invoked via:
In
Database.kt, question #4 (line 162) contains a literal forward slash/:Impact
In Jetpack Compose Navigation, route segments are separated by
/. When this question (or any question containing/,?, or#) is randomly selected, route matching fails or throws anIllegalArgumentException, crashing the app when "Start Recording" is clicked.Suggested Fix
recordIdas a route argument and load questions from the database, or pass only question IDs (question1Id, etc.).Uri.encode(q)when constructing the route and decode on the destination side.Test Issueto Navigation crashes when question contains slashes ('/') or special characters