Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionInInitializerError in CommonMarkFlavourDescriptor.createInlinesLexer - MarkdownParser.doParseInline #162

Open
eboudrant opened this issue Jun 19, 2024 · 5 comments

Comments

@eboudrant
Copy link

eboudrant commented Jun 19, 2024

We're seeing a crash with the markdown library used in Android/Compose UI, we can't really reproduce it but I'll try to add more informations when I can. The the crash happened with strings that are about 40-50 char length and contains no markdown chars like ** * [ ] ( ) _. We can't get the actual content of the string.

We're using markdown 0.6.1.

java.lang.ExceptionInInitializerError
        at org.intellij.markdown.flavours.commonmark.CommonMarkFlavourDescriptor.createInlinesLexer(CommonMarkFlavourDescriptor:35)
        at org.intellij.markdown.parser.MarkdownParser.doParseInline(MarkdownParser:88)
        at org.intellij.markdown.parser.MarkdownParser.parseInline(MarkdownParser:45)
        at org.intellij.markdown.parser.MarkdownParser$InlineExpandingASTNodeBuilder.createLeafNodes(MarkdownParser:123)
        at org.intellij.markdown.parser.TopLevelBuilder.createASTNodeOnClosingEvent(TopLevelBuilder:21)
        at org.intellij.markdown.parser.TreeBuilder.buildTree(TreeBuilder:48)
        at org.intellij.markdown.parser.MarkdownParser.doParse(MarkdownParser:83)
        at org.intellij.markdown.parser.MarkdownParser.parse(MarkdownParser:33)
        at org.intellij.markdown.parser.MarkdownParser.buildMarkdownTreeFromString(MarkdownParser:28)
        ...
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'char java.lang.String.charAt(int)' on a null object reference
        at org.intellij.markdown.lexer._MarkdownLexer$Companion.zzUnpackTrans(_MarkdownLexer:560)
        at org.intellij.markdown.lexer._MarkdownLexer$Companion.zzUnpackTrans(_MarkdownLexer:551)
        at org.intellij.markdown.lexer._MarkdownLexer$Companion.access$zzUnpackTrans(_MarkdownLexer:447)
@fnfunfunc
Copy link

We've got this issue on 0.7.3 too

@AlexanderGH
Copy link

I suspect this is a Dexguard/Proguard bug. Adding explicit keep rules for those classes seems to fix the issue.

@fnfunfunc
Copy link

I suspect this is a Dexguard/Proguard bug. Adding explicit keep rules for those classes seems to fix the issue.

Which fields/functions should I keep?

@AlexanderGH
Copy link

AlexanderGH commented Jan 30, 2025

The one(s) throwing the exception:

org.intellij.markdown.lexer._MarkdownLexer
org.intellij.markdown.lexer._MarkdownLexer$Companion

Can you confirm if you're using Dexguard, or Proguard, or just R8? And if it's Dexguard, would you mind filing a ticket with them?

@fnfunfunc
Copy link

The one(s) throwing the exception:

org.intellij.markdown.lexer._MarkdownLexer
org.intellij.markdown.lexer._MarkdownLexer$Companion

Can you confirm if you're using Dexguard, or Proguard, or just R8? And if it's Dexguard, would you mind filing a ticket with them?

I'm using Proguard and I will try to keep these classes, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants