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

NPE when saving encrypted file

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 1.8.10, 2.0.0
    • Fix Version/s: 1.8.10, 2.0.0
    • Component/s: Crypto, Writing
    • Labels:
      None

      Description

      Mailing list user gets this when loading and then saving an encrypted file (of which he didn't know it was encrypted):

      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) 
      

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

        Attachments

        1. PDFBOX-2769.pdf
          46 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment