[
https://issues.apache.org/jira/browse/PDFBOX-1926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13905980#comment-13905980
]
John Hewson commented on PDFBOX-1926:
-------------------------------------
Yep, we should be throwing an IOException.
> Document.save() after Document.close() causes Null Pointer Exception
> --------------------------------------------------------------------
>
> Key: PDFBOX-1926
> URL: https://issues.apache.org/jira/browse/PDFBOX-1926
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.8.4
> Environment: Linux (Ubuntu)
> Reporter: Bastian Preindl
>
> Until version 1.8.3 it was possible to perform a document's save()-call also
> if the document's close()-method has already been called. In my opinion this
> made sense as I'd like to persist the document's content also if no more
> (content changing) operations are performed on it.
> Anyway, in 1.8.4, calling save() after close() causes a NullPointerException:
> Caused by: java.lang.NullPointerException
> at
> org.apache.pdfbox.pdmodel.PDDocument.getDocumentCatalog(PDDocument.java:765)
> at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1346)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)