HapRamp v0.0.11 - App crashes due to parsing error on posts having a title being started by a special character
Project Information
- Repository:
https://github.com/hapramp/1Rramp-Android - Project Name: 1ramp- Android
- Publisher: @the-dragon / @singhpratyush
Expected behavior
Posts having a title being started by a special character should be displayed when tapped.
Actual behavior
Upon tapping a post that has a title being started by a special character, the app crashes.
How to reproduce
- In the "Home" page, select a "Community" and tap its designated icon.
- Select a post that has a title being started by a special character and tap it.
- Upon tapping that post, the app crashes.
Logcat Report
08-17 22:14:27.440 9321 9321 E AndroidRuntime: FATAL EXCEPTION: main
08-17 22:14:27.440 9321 9321 E AndroidRuntime: Process: com.hapramp, PID: 9321
08-17 22:14:27.440 9321 9321 E AndroidRuntime: java.lang.ExceptionInInitializerError
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.InlineParserImpl.parseEntity(InlineParserImpl.java:751)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.InlineParserImpl.parseInline(InlineParserImpl.java:303)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.InlineParserImpl.parse(InlineParserImpl.java:174)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.ParagraphParser.parseInlines(ParagraphParser.java:61)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.DocumentParser.processInlines(DocumentParser.java:410)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.DocumentParser.finalizeAndProcess(DocumentParser.java:529)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.DocumentParser.parse(DocumentParser.java:118)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.parser.Parser.parse(Parser.java:63)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.hapramp.utils.RegexUtils.getHtmlContent(RegexUtils.java:15)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.hapramp.ui.activity.DetailedActivity.renderMarkdown(DetailedActivity.java:296)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.hapramp.ui.activity.DetailedActivity.bindPostValues(DetailedActivity.java:285)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.hapramp.ui.activity.DetailedActivity.collectExtras(DetailedActivity.java:181)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.hapramp.ui.activity.DetailedActivity.onCreate(DetailedActivity.java:162)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6904)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:229)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7406)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: Caused by: java.lang.NullPointerException: lock == null
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at java.io.Reader.<init>(Reader.java:64)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at java.io.InputStreamReader.<init>(InputStreamReader.java:122)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.util.Html5Entities.readEntities(Html5Entities.java:54)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: at org.commonmark.internal.util.Html5Entities.<clinit>(Html5Entities.java:17)
08-17 22:14:27.440 9321 9321 E AndroidRuntime: ... 25 more
In the above logcat report, the issue is caused by java.lang.NullPointerException: lock == null
, at Html5Entities.java especially in lines 17 and 54, which in turn causes error in the following files: InlineParserImpl.java, ParagraphParser.java, DocumentParser.java, Parser.java, DetailedActivity.java, RegexUtils.java and etc.
Environment
- App version: 1ramp v0.0.10 (at the time of detection) and v0.0.11
- Device: Samsung Galaxy J2 Prime (SM-G532G/DS)
- Operating system: Android version 6.0.1
Hi @josephace135, thanks for making this contribution.
I was able to replicate the above error. The app crashes when loading a post that has a special character before the title's text. The developers are aware of this thanks to you, and should have it fixed before the next version release.
Caused by: java.lang.NullPointerException: lock == null
was caused by the application's inability to access an object before it has been created, at least that's what this exception means. This could have been as a result of the exception encountered in this linejava.lang.ExceptionInInitializerError
You get this error whenever something goes wrong in the static initializer block. The special character obviously messed some code up, that the PO would have to look into.Thanks again for the contribution, it is a great find. I look forward to your next contribution,
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Thank you for your review, @fego!
So far this week you've reviewed 4 contributions. Keep up the good work!
Hey @josephace135
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Hi @josephace135! We are @steem-ua, a new Steem dApp, computing UserAuthority for all accounts on Steem. We are currently in test modus upvoting quality Utopian-io contributions! Nice work!
Congratulations @josephace135! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Award for the total payout received
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.
Congratulations @josephace135! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.
Congratulations @josephace135! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of upvotes received
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.
Congratulations! This post has been upvoted from the communal account, @minnowsupport, by josephace135 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.
If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.