pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4444) NPE in PDNumberTreeNode.convertCOSToPD()
Date Sat, 26 Jan 2019 09:34:00 GMT

    [ https://issues.apache.org/jira/browse/PDFBOX-4444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16752971#comment-16752971
] 

ASF subversion and git services commented on PDFBOX-4444:
---------------------------------------------------------

Commit 1852205 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1852205 ]

PDFBOX-4444: avoid NPE

> NPE in PDNumberTreeNode.convertCOSToPD()
> ----------------------------------------
>
>                 Key: PDFBOX-4444
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4444
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.13
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.14, 3.0.0 PDFBox
>
>         Attachments: 172572.pdf
>
>
> {noformat}
> 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)
> {noformat}
> There are null elements in the number tree at {{Root/StructTreeRoot/ParentTree/Kids/[0]/Nums}}
> Solution: just pass the null, don't convert it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message