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

NullPointerException on EPUB containing invalid links in Navigation Document #1516

Closed
shiestyle opened this issue May 5, 2023 · 0 comments · Fixed by #1524 or #1525
Closed

NullPointerException on EPUB containing invalid links in Navigation Document #1516

shiestyle opened this issue May 5, 2023 · 0 comments · Fixed by #1524 or #1525
Assignees
Labels
status: has PR The issue is being processed in a pull request type: bug The issue describes a bug
Milestone

Comments

@shiestyle
Copy link

We found a NullPointerException case when navigation document has an incorrect link.

<nav epub:type="toc" id="toc">
<h1>Navigation</h1>
<ol>
<li><a href="xhtml/p-cover.xhtml">cover</a></li>
<li><a href="xhtml/p-001.xhtml#xxx">p-001</a></li>
</ol>
</nav>

If p-001.xhtml doesn't have an anchor #xxx, NullPointerException will be occurred.

Sorry but Japanese error messages are included.

ERROR(RSC-012): C:\t\20230306-errordata.epub/item/navigation-documents.xhtml(18,37): フラグメント識別子が定義されていません.
java.lang.NullPointerException: Cannot invoke "java.util.List.indexOf(Object)" because the return value of "java.util.Map.get(Object)" is null
	at org.w3c.epubcheck.core.references.ResourceRegistry.getIDPosition(ResourceRegistry.java:57)
	at org.w3c.epubcheck.core.references.ResourceReferencesChecker.checkReadingOrder(ResourceReferencesChecker.java:451)
	at org.w3c.epubcheck.core.references.ResourceReferencesChecker.check(ResourceReferencesChecker.java:105)
	at com.adobe.epubcheck.opf.OPFChecker.checkPackage(OPFChecker.java:149)
	at com.adobe.epubcheck.opf.OPFChecker30.checkPackage(OPFChecker30.java:67)
	at com.adobe.epubcheck.opf.OPFChecker.check(OPFChecker.java:94)
	at com.adobe.epubcheck.ocf.OCFChecker.check(OCFChecker.java:174)
	at com.adobe.epubcheck.api.EpubCheck.doValidate(EpubCheck.java:218)
	at com.adobe.epubcheck.tool.EpubChecker.validateFile(EpubChecker.java:245)
	at com.adobe.epubcheck.tool.EpubChecker.processFile(EpubChecker.java:320)
	at com.adobe.epubcheck.tool.EpubChecker.run(EpubChecker.java:145)
	at com.adobe.epubcheck.tool.Checker.main(Checker.java:31)
@rdeltour rdeltour self-assigned this Jun 30, 2023
@rdeltour rdeltour added type: bug The issue describes a bug status: accepted Ready to be further processed labels Jul 5, 2023
@rdeltour rdeltour added this to the Next maintenance release milestone Jul 5, 2023
@rdeltour rdeltour added status: has PR The issue is being processed in a pull request and removed status: accepted Ready to be further processed labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: has PR The issue is being processed in a pull request type: bug The issue describes a bug
Projects
None yet
2 participants