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

Intermittent NullPointerException: link-destination #171

Closed
damianw opened this issue Oct 15, 2019 · 3 comments · Fixed by #172
Closed

Intermittent NullPointerException: link-destination #171

damianw opened this issue Oct 15, 2019 · 3 comments · Fixed by #172
Labels
Milestone

Comments

@damianw
Copy link

damianw commented Oct 15, 2019

  • Markwon version: 4.1.1

We are occasionally seeing reports of the following error during rendering. It's very intermittent, and is probably some kind of race condition (we are rendering multiple documents in parallel using the same Markwon instance as previously mentioned in this other issue). I don't think I can really provide more information as I haven't yet been able to reproduce it manually.

Caused by java.lang.NullPointerException: link-destination
       at io.noties.markwon.Prop.require(Prop.java:52)
       at io.noties.markwon.core.factory.LinkSpanFactory.getSpans(LinkSpanFactory.java:18)
       at io.noties.markwon.MarkwonVisitorImpl.setSpansForNodeOptional(MarkwonVisitorImpl.java:261)
       at io.noties.markwon.MarkwonVisitorImpl.setSpansForNodeOptional(MarkwonVisitorImpl.java:254)
       at io.noties.markwon.core.CorePlugin$15.visit(CorePlugin.java:514)
       at io.noties.markwon.core.CorePlugin$15.visit(CorePlugin.java:502)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:172)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:125)
       at org.commonmark.node.Link.accept(Link.java:38)
       at io.noties.markwon.MarkwonVisitorImpl.visitChildren(MarkwonVisitorImpl.java:203)
       at io.noties.markwon.core.CorePlugin$14.visit(CorePlugin.java:474)
       at io.noties.markwon.core.CorePlugin$14.visit(CorePlugin.java:463)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:172)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:140)
       at org.commonmark.node.Paragraph.accept(Paragraph.java:7)
       at io.noties.markwon.MarkwonVisitorImpl.visitChildren(MarkwonVisitorImpl.java:203)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:174)
       at io.noties.markwon.MarkwonVisitorImpl.visit(MarkwonVisitorImpl.java:75)
       at org.commonmark.node.Document.accept(Document.java:7)
       at io.noties.markwon.MarkwonImpl.render(MarkwonImpl.java:66)
@noties noties added the bug label Oct 15, 2019
@noties
Copy link
Owner

noties commented Oct 15, 2019

Hello @damianw !

Thank you for the hint. RenderProps were still re-used between multiple render calls. I've fixed that and published 4.1.2-SNAPSHOT version

@noties noties added this to the 4.1.2 milestone Oct 15, 2019
@noties noties mentioned this issue Oct 16, 2019
@noties
Copy link
Owner

noties commented Oct 16, 2019

Hello @damianw !

As you can imagine this kind of issue is hard to track. I could not reproduce it with code, but there is a big chance that this behavior was caused by RenderProps being shared between multiple visitors. This was an oversight and I think this should be fixed in 4.1.2 release that I had just published 🙌

@damianw
Copy link
Author

damianw commented Oct 16, 2019

Thanks @noties! I will update and see if it fixes the issue. 👍

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

Successfully merging a pull request may close this issue.

2 participants