Skip to content

NullPointerException on EPUB containing SVG image with DublinCore metadata(?) #1514

Closed

Description

@kingjon3377

I'm getting a NullPointerException when I try to run EpubCheck 5.0.1 on my EPUBs. I've managed to prepare a reasonably minimal example (attached, renamed to .ZIP: minimal.zip; constructed from this minimal EPUB project (with its errors fixed up) and then this public-domain SVG image embedded). The command-line output, including the stacktrace, is as follows:

Validating using EPUB version 3.3 rules.
java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.mediaSources" is null
	at com.adobe.epubcheck.ops.OPSHandler30.startMediaSource(OPSHandler30.java:614)
	at com.adobe.epubcheck.ops.OPSHandler30.startElement(OPSHandler30.java:421)
	at com.adobe.epubcheck.xml.handlers.XMLHandler.startElement(XMLHandler.java:115)
	at com.adobe.epubcheck.xml.handlers.DelegateDefaultHandler.startElement(DelegateDefaultHandler.java:170)
	at com.adobe.epubcheck.xml.handlers.WrappingDefaultHandler.startElement(WrappingDefaultHandler.java:95)
	at com.adobe.epubcheck.xml.handlers.PreprocessingDefaultHandler.startElement(PreprocessingDefaultHandler.java:59)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
	at com.adobe.epubcheck.xml.XMLParser.process(XMLParser.java:176)
	at com.adobe.epubcheck.ops.OPSChecker.validate(OPSChecker.java:127)
	at com.adobe.epubcheck.ops.OPSChecker.checkContent(OPSChecker.java:97)
	at com.adobe.epubcheck.opf.PublicationResourceChecker.check(PublicationResourceChecker.java:45)
	at com.adobe.epubcheck.opf.OPFChecker.checkItemContent(OPFChecker.java:398)
	at com.adobe.epubcheck.opf.OPFChecker.checkPackage(OPFChecker.java:136)
	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:173)
	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)
Messages: 0 fatals / 0 errors / 0 warnings / 0 infos

EPUBCheck completed

Activity

  1. shiestyle commented on May 4, 2023

    @shiestyle

    We found a similar 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.

  2. rdeltour commented on May 4, 2023

    @rdeltour
    Member

    Definitely looks like a bug. Thanks for the report @kingjon3377!

    @shiestyle yours seem to be a different case, would you mind opening a separate issue?

  3. self-assigned this
    on May 4, 2023
  4. added a commit that references this issue on Jul 6, 2023
    c15e4ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: acceptedReady to be further processedtype: bugThe issue describes a bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址