Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4444

NPE in PDNumberTreeNode.convertCOSToPD()

    XMLWordPrintableJSON

    Details

      Description

      java.io.IOException: Error while trying to create value in number tree:null
      	at org.apache.pdfbox.pdmodel.common.PDNumberTreeNode.convertCOSToPD(PDNumberTreeNode.java:226)
      	at org.apache.pdfbox.pdmodel.common.PDNumberTreeNode.getNumbers(PDNumberTreeNode.java:197)
      	at org.apache.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:972)
      	at org.apache.pdfbox.multipdf.PDFMergerUtility.getNumberTreeAsMap(PDFMergerUtility.java:987)
      	at org.apache.pdfbox.multipdf.PDFMergerUtilityTest.checkWithNumberTree(PDFMergerUtilityTest.java:636)
      	at org.apache.pdfbox.multipdf.PDFMergerUtilityTest.testXXX(PDFMergerUtilityTest.java:1120)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at junit.framework.TestCase.runTest(TestCase.java:176)
      	at junit.framework.TestCase.runBare(TestCase.java:141)
      	at junit.framework.TestResult$1.protect(TestResult.java:122)
      	at junit.framework.TestResult.runProtected(TestResult.java:142)
      	at junit.framework.TestResult.run(TestResult.java:125)
      	at junit.framework.TestCase.run(TestCase.java:129)
      	at junit.framework.TestSuite.runTest(TestSuite.java:252)
      	at junit.framework.TestSuite.run(TestSuite.java:247)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
      	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
      Caused by: java.lang.NullPointerException
      	at org.apache.pdfbox.pdmodel.common.PDNumberTreeNode.convertCOSToPD(PDNumberTreeNode.java:219)
      

      There are null elements in the number tree at Root/StructTreeRoot/ParentTree/Kids/[0]/Nums

      Solution: just pass the null, don't convert it.

        Attachments

        1. 172572.pdf
          4.91 MB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: