[
https://issues.apache.org/jira/browse/PDFBOX-6132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18049860#comment-18049860
]
Tilman Hausherr edited comment on PDFBOX-6132 at 1/5/26 2:29 PM:
-----------------------------------------------------------------
I have avoided the NPE until we have a better solution. I haven't been able to
reproduce it in 2.0, however I found another occurrence in 3.0 and the trunk.
was (Author: tilman):
I have avoided the NPE until we have a better solution.
> NullPointerException in `COSDocument.getLinearizedDictionary()` when
> xrefTable contains null key
> ------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-6132
> URL: https://issues.apache.org/jira/browse/PDFBOX-6132
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 3.0.6 PDFBox
> Reporter: Tilman Hausherr
> Priority: Major
>
> Posted by Haoran Yan on the users mailing list:
> NullPointerException (NPE) in COSDocument. Specifically, when a
> cross-reference table (xrefTable) containing a null key is added via
> addXRefTable(), calling getLinearizedDictionary() results in an unhandled NPE
> at line 219 of COSDocument.java.
> Reproduce:
> Run the following test case:
> {code:java}
> public class TestClass {
> @Test
> public void test() {
> COSDocument document = new COSDocument();
> Map<COSObjectKey, Long> xrefTable = new HashMap<>();
> xrefTable.put(null, 10L);
> document.addXRefTable(xrefTable);
> document.getLinearizedDictionary();
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]