Tilman Hausherr created PDFBOX-2769:
---------------------------------------

             Summary: NPE when saving encrypted file
                 Key: PDFBOX-2769
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2769
             Project: PDFBox
          Issue Type: Bug
          Components: Writing
    Affects Versions: 2.0.0
            Reporter: Tilman Hausherr
             Fix For: 2.0.0


Mailing list user gets this when loading and then saving an encrypted file (of 
which he didn't know it was encrypted):
{code}
java.lang.NullPointerException
    at 
org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeRevisionNumber(StandardSecurityHandler.java:129)
    at 
org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareDocumentForEncryption(StandardSecurityHandler.java:332)
    at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1254)
    at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1215)
    at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:958)
    at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:930) 
{code}

At the very least, we should bring an IllegalStateException with a useful 
message telling what to do.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to