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

Fix NullPointer exception in PDFALTOOutlineSaxHandler #729

Merged
merged 6 commits into from
Apr 14, 2021

Commits on Feb 16, 2021

  1. Fix NullPointer exception in PDFALTOOutlineSaxHandler

    I observed the following error. 
    
    févr. 12, 2021 3:20:44 PM org.grobid.core.document.Document addTokenizedDocument
    GRAVE: Cannot parse file: my_dir/grobid-0.6.1/grobid-home/tmp/ZW3PpM4E9g.lxml_outline.xml
    
    févr. 12, 2021 3:20:44 PM org.grobid.core.document.Document addTokenizedDocument
    GRAVE: Cannot parse file: my_dir/grobid-0.6.1/grobid-home/tmp/ZW3PpM4E9g.lxml_outline.xml
    
    févr. 12, 2021 3:20:46 PM org.grobid.core.engines.ProcessEngine createTraining
    INFOS: 2 files processed.
    
    it originates in an illegal nullPointer access in file PDFALTOOutlineSaxHandler.java. 
    
    In understand that the error is not  that "GRAVE". According to @kermitt2, it is simply one of the generated XML file resulting from the PDF parsing which is not XML valid (very frequent) - it has no impact because the outline file (containing the table of content outline if available embedded in the PDF) is not exploited by GROBID for the moment - it's to allow some possible improvements in the future. The error is more a reminder for the developers... the XML parser that classifies it as "GRAVE" but it would be rather INFO for us.
    
    Unfortunately, a side effect might have been overlooked. If father is null, then father.addChild(currentNode) is called with a nullPointer exception.
    
    This exception is caught by catch (Exception e) at line 372 in grobid-core/src/main/java/org/grobid/core/document/Document.java where the error message "Cannot parse" is misleading.
    
    I think an additional else is just missing.
    lucbouge committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    62599b4 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2021

  1. Update PDFALTOOutlineSaxHandler.java

    I cleaned up the correction as requested. Luc.
    lucbouge committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    2340aa7 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2021

  1. fixing wrong assignment of father id and wrong override of label, add…

    …ing a test case, rename test to match the class name
    lfoppiano committed Mar 2, 2021
    Configuration menu
    Copy the full SHA
    300efd3 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2021

  1. Configuration menu
    Copy the full SHA
    6ad419f View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2021

  1. Configuration menu
    Copy the full SHA
    7433c89 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    01e0e4f View commit details
    Browse the repository at this point in the history