QuantumBadger / QuantumBadger/RedReader
Crash when trying to open user subreddits (r/u_user) for users with a dash (-) in their username
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 527
- Avg merge
- 20d 10h
- Merged PRs (30d)
- 3
Description
Please note, the example user here ( u_Ruby_Soho- ) is NSFW, I only encounter this issue with my NSFW account because of how I use Reddit. This particular one also contains underscores ( _ ) but I know from other encounters that those are fine and it's the dash that is the problem.
In order to actually follow a user requires being able to open the user subreddit ( /r/u_username ) for them, but that isn't possible if the username contains a dash/hyphen ( - ) because the app hits an exception. Also tested with latest RedReader alpha version 363. (And earlier)
Here's the report it generated for sending by email, which I've done before, but this is the issue tracker.
Error report -- RedReader v1.25
Manufacturer: Google
Model: Pixel 7 Pro
Product: cheetah
Android release: 16
Android SDK: 36
Exception: java.lang.RuntimeException
Got exception for subreddit: u_Ruby_Soho-
okio.-SegmentedByteString.onActionMenuItemSelected(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:492)
org.quantumbadger.redreader.common.LinkHandler$$ExternalSyntheticLambda3.onClick(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:104)
androidx.appcompat.app.AlertController$AlertParams$3.onItemClick(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:9)
android.widget.AdapterView.performItemClick(AdapterView.java:330)
android.widget.AbsListView.performItemClick(AbsListView.java:1274)
android.widget.AbsListView$PerformClick.run(AbsListView.java:3287)
android.widget.AbsListView$3.run(AbsListView.java:4266)
android.os.Handler.handleCallback(Handler.java:995)
android.os.Handler.dispatchMessage(Handler.java:103)
android.os.Looper.loopOnce(Looper.java:248)
android.os.Looper.loop(Looper.java:338)
android.app.ActivityThread.main(ActivityThread.java:9067)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
Caused by: Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'android.net.Uri org.quantumbadger.redreader.reddit.url.RedditURLParser$RedditURL.generateJsonUri()' on a null object reference
okio.-SegmentedByteString.onActionMenuItemSelected(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:470)
org.quantumbadger.redreader.common.LinkHandler$$ExternalSyntheticLambda3.onClick(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:104)
androidx.appcompat.app.AlertController$AlertParams$3.onItemClick(r8-map-id-a302616bba84542209fb8ae7bdf0d77a04273f04707f227de4c5acb4da43a210:9)
android.widget.AdapterView.performItemClick(AdapterView.java:330)
android.widget.AbsListView.performItemClick(AbsListView.java:1274)
android.widget.AbsListView$PerformClick.run(AbsListView.java:3287)
android.widget.AbsListView$3.run(AbsListView.java:4266)
android.os.Handler.handleCallback(Handler.java:995)
android.os.Handler.dispatchMessage(Handler.java:103)
android.os.Looper.loopOnce(Looper.java:248)
android.os.Looper.loop(Looper.java:338)
android.app.ActivityThread.main(ActivityThread.java:9067)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the user-subreddit action through LinkHandler and RedditURLParser, focusing on the null RedditURLParser.RedditURL before generateJsonUri() is called. Reproduce the crash with the reported username containing a dash, such as u_Ruby_Soho-, and verify that opening the user subreddit no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100